Quote:
Originally Posted by Seven_of_Nine
corrected:
pawn Код:
new twice = 0; // Creates a variable with the value 0. if(cmdtext == "/rules") { //checks we typed /rules if(twice == 0) { //if our variable (twice) is still 0, then it adds one (so twice is 1 now.) twice++; } else { //Now, we've got the twice 1, and typed /rules, so it returns that message: twice = 0; //sets twice 0 to repeat the code. return SendClientMessage(playerid,red,"You've typed /rules twice!");//sends this message, and it doesnt perform /rules. } }
|
Yours will not work, you create a global varible 'twice' you need a player varible.