09.06.2010, 13:04
It's a very tricky question :P
How is it possible to get the command entered 3 times in a row.MMMMMMMMMM
I know
Take these three commands for eg:
Under OnPlayerConnect
OnPlayerCommandText
How about that?
How is it possible to get the command entered 3 times in a row.MMMMMMMMMM
I know
Take these three commands for eg:
Код:
new bool:firstcmd[MAX_PLAYERS]; new helpcmd[MAX_PLAYERS]; new mecmd[MAX_PLAYERS]; new killcmd[MAX_PLAYERS];
Код:
firstcmd[playerid]=true;
Код:
if(!strcmp(cmdtext,"/help",5,true)) { if(firstcmd[playerid]==true) { firstcmd[playerid]=false; helpcmd[playerid]++; } else helpcmd++; killcmd[playerid]=0; mecmd[playerid]=0; //your helpcode if(helpcmd[playerid]>3) { Kick(playerid); } return 1; } if(!strcmp(cmdtext,"/me",3,true)) { if(firstcmd[playerid]==true) { firstcmd[playerid]=false; mecmd[playerid]++; } else mecmd[playerid]++; killcmd[playerid]=0; helpcmd[playerid]=0; //your me code if(mecmd[playerid]>3) { Kick(playerid); } return 1; } if(!strcmp(cmdtext,"/kill",5,true)) { if(firstcmd[playerid]==true) { firstcmd[playerid]=false; killcmd[playerid]++; } else killcmd[playerid]++; mecmd[playerid]=0; helpcmd[playerid]=0; //your kill code if(killcmd[playerid]>3) { Kick(playerid); } return 1; }