15.10.2009, 19:28
Quote:
Originally Posted by Shinzei_Banzai
Quote:
|
pawn Код:
new bool:myVariable = false;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/mycommand1", true) == 0)
{
if(myVariable == false)
{
myVariable = true; // set variable to true.
}
else if(myVariable == true)
{
myVariable = false; // set variable to false.
}
return 1;
}
if(strcmp(cmdtext, "/mycommand2", true) == 0)
{
if(myVariable == true)
{
// myVariable is true, you can execute your code.
}
else if(myVariable == false)
{
// myVariable is NOT true (it's false), send message that user can't use this command.
}
return 1;
}
return 0;
}