SA-MP Forums Archive
Typing commands twice - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Typing commands twice (/showthread.php?tid=106301)



Typing commands twice - Redirect Left - 02.11.2009

Does anyone know why i may have to type a command twice to trigger it? The first time nothing happens, the seconds time it'd work. anyone know any causes for it?


Re: Typing commands twice - dice7 - 02.11.2009

pawn Код:
new cmdtrigger = 0;
if(strcmp(cmdtext, "/somecmd") == 0)
{
  if(cmdtrigger == 0)
  {
    //nothing happens
    cmdtrigger++;
    return 1;
  }
  else
  {
    //command gets executed
    cmdtrigger = 0;
    return 1;
  }
}



Re: Typing commands twice - Redirect Left - 02.11.2009

er, that'd make it need to be typed twice, i'm trying to figure out how to STOP it, I have a bug in my script somewhere, i just need to know what causes it, it affects all commands, and there is nothing like that in it.


Re: Typing commands twice - Danny_Costelo - 05.11.2009

Quote:
Originally Posted by Redirect Left
er, that'd make it need to be typed twice, i'm trying to figure out how to STOP it, I have a bug in my script somewhere, i just need to know what causes it, it affects all commands, and there is nothing like that in it.
Well unless you want to share your code, we can't do anything, re-look trough your OPCT callback.