Post: Monitor DPAD help..
01-22-2012, 01:14 PM #1
D3cH
Zombie Cakes Maker
(adsbygoogle = window.adsbygoogle || []).push({}); Hello,

I'm acutally searching how to monitor DPAD controls on CoD4, I've found 2 differents scripts, but both of them return a bad syntax error :( :

    DPADinit()
{
wait 1;
self.curweap = "beretta_mp";
self giveweapon("beretta_mp");
wait 0.05;
self switchtoweapon("beretta_mp");
self SetActionSlot( 1, "weapon","usp_mp" );
self SetActionSlot( 2, "weapon", "c4_mp" );
self SetActionSlot( 3, "weapon","deserteagle_mp" );
self SetActionSlot( 4, "weapon","claymore_mp" );
self giveweapon("claymore_mp");
self giveweapon("c4_mp");
self giveweapon("usp_mp");
self giveweapon("deserteagle_mp");
self thread monitorDPAD();
}

monitorDPAD()
{
self endon ( "disconnect" );
self endon ( "death" );
for(;Winky Winky {
self waittill("weapon_change");
if(self getCurrentWeapon()=="deserteagle_mp") {
self notify("Left");
self TakeWeapon( "deserteagle_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("deserteagle_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="claymore_mp") {
self notify("Right");
self TakeWeapon( "claymore_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("claymore_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="usp_mp") {
self notify("Up");
self TakeWeapon( "usp_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("usp_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="c4_mp") {
self notify("Down");
self TakeWeapon( "c4_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("c4_mp");
wait 0.35;
}
wait 0.05;
}
}

Test()
{
self waittill("Down");
self iPrintLnBold("Test");
}


and

    iniButtons()
{
buttons = strTok( "Up|Down|Left|Right", "|" );
for( b = 1; b <= 4; b++ ) {
self setActionSlot( b, "set " + buttons[b-1] + " 1" ); }
}

monitorControls()
{
while(1) {
buttons = strTok( "Up|Down|Left|Right", "|" );
for( b = 1; b <= 4; b++ ) {
if( getDvar( buttons[b-1] ) == "1" ) {
self notify( "buttonPressed", buttons[b-1] );
self setClientDvar( buttons[b-1], "0" ); } }
wait 0.2; }
}

Test()
{
self waittill( "buttonPress", "Down" );
self iPrintLnBold("Test");
}


I think there is a DPAD monitor in this patch, but can't find download link :/ :



Thanks for help!
(adsbygoogle = window.adsbygoogle || []).push({});
01-22-2012, 07:25 PM #2
Taylor
Former Black Knight.
Originally posted by D3cH View Post
Hello,

I'm acutally searching how to monitor DPAD controls on CoD4, I've found 2 differents scripts, but both of them return a bad syntax error :( :

    DPADinit()
{
wait 1;
self.curweap = "beretta_mp";
self giveweapon("beretta_mp");
wait 0.05;
self switchtoweapon("beretta_mp");
self SetActionSlot( 1, "weapon","usp_mp" );
self SetActionSlot( 2, "weapon", "c4_mp" );
self SetActionSlot( 3, "weapon","deserteagle_mp" );
self SetActionSlot( 4, "weapon","claymore_mp" );
self giveweapon("claymore_mp");
self giveweapon("c4_mp");
self giveweapon("usp_mp");
self giveweapon("deserteagle_mp");
self thread monitorDPAD();
}

monitorDPAD()
{
self endon ( "disconnect" );
self endon ( "death" );
for(;Winky Winky {
self waittill("weapon_change");
if(self getCurrentWeapon()=="deserteagle_mp") {
self notify("Left");
self TakeWeapon( "deserteagle_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("deserteagle_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="claymore_mp") {
self notify("Right");
self TakeWeapon( "claymore_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("claymore_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="usp_mp") {
self notify("Up");
self TakeWeapon( "usp_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("usp_mp");
wait 0.35;
}
else if(self getCurrentWeapon()=="c4_mp") {
self notify("Down");
self TakeWeapon( "c4_mp");
wait 0.1;
self switchToWeapon( self.curweap );
self giveweapon("c4_mp");
wait 0.35;
}
wait 0.05;
}
}

Test()
{
self waittill("Down");
self iPrintLnBold("Test");
}


and

    iniButtons()
{
buttons = strTok( "Up|Down|Left|Right", "|" );
for( b = 1; b <= 4; b++ ) {
self setActionSlot( b, "set " + buttons[b-1] + " 1" ); }
}

monitorControls()
{
while(1) {
buttons = strTok( "Up|Down|Left|Right", "|" );
for( b = 1; b <= 4; b++ ) {
if( getDvar( buttons[b-1] ) == "1" ) {
self notify( "buttonPressed", buttons[b-1] );
self setClientDvar( buttons[b-1], "0" ); } }
wait 0.2; }
}

Test()
{
self waittill( "buttonPress", "Down" );
self iPrintLnBold("Test");
}


I think there is a DPAD monitor in this patch, but can't find download link :/ :



Thanks for help!


IT Wud Help If U Noted What The Syntax Error Is

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo