Stop commands - 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)
+--- Thread: Stop commands (
/showthread.php?tid=547534)
Stop commands -
dundolina - 23.11.2014
How to stop commands for every player who is in the jail?
AW: Stop commands -
Mellnik - 23.11.2014
OnPlayerCommandReceived()
if( is in jail)
return 0;
Re: Stop commands -
dundolina - 23.11.2014
Where to add this?
Re: Stop commands -
dundolina - 23.11.2014
Please help me..
Re: AW: Stop commands -
OsteeN - 23.11.2014
Use what he said.
Quote:
Originally Posted by Mellnik
OnPlayerCommandReceived()
if( is in jail)
return 0;
|
Put "if(YourCheckIfPlayerIsInJailHere) return 0;" under "public OnPlayerCommandReceived()".
Re: AW: Stop commands -
AdHaM612 - 23.11.2014
Quote:
Originally Posted by Mellnik
OnPlayerCommandReceived()
if( is in jail)
return 0;
|
Quote:
Originally Posted by OsteeN
Use what he said.
Put "if(YourCheckIfPlayerIsInJailHere) return 0;" under "public OnPlayerCommandReceived()".
|
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(/*Put your jail variable here*/)
{
return 0;
}
return 0;
}
Re: AW: Stop commands -
OsteeN - 23.11.2014
Quote:
Originally Posted by AdHaM612
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(/*Put your jail variable here*/) { return 0; } return 0; }
|
Yeah, I just copied the other guys callback, lol.
Re: Stop commands -
dundolina - 23.11.2014
Can you give me some other way? I really dont understand this way..
Re: Stop commands -
LeXuZ - 23.11.2014
EDIT: Nevermind, did it wrong, sorry
Re: AW: Stop commands -
PinkFloydLover - 25.11.2014
Quote:
Originally Posted by AdHaM612
Do as they both said, but the callback is "OnPlayerCommandText".
So it would be:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(/*Put your jail variable here*/) { return 0; } if(strcmp, blah blah.....//strcmp command { return 1; } return 0; }
|
shouldn't have to change command processors to do this. it's already been posted multiple times.
You don't need the zcmd callback OnPlayerRecievedCommand or whatever it is, you can put it in onPlayercommandText, just make sure its the first thing in the callback, all your strcmp commands must be below it see the example i edited.