13.07.2012, 21:23
Quote:
im confused. So I can't use /suicide command everywhere?
Edit: What if i leave /drag and go to other place like /aa, Can suicide automatically enabled in /aa?? |
pawn Code:
gCommandsDisabled[playerid]=true;
for example I don't want player to /suicide after he uses command /teleport, but if really needed player can use command /sorry to enable commands:
pawn Code:
OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext,"/teleport")==0)
{
SetPlayerPos(playerid,0,1,2);
gCommandsDisabled[playerid]==true;
return 1;
}
if(strcmp("/suicide",cmdtext)==0)
{
if(gCommandsDisabled[playerid]==true)return SendClientMessage(playerid,0xFF0000FF,"More luck next time!");
SetPlayerHealth(playerid,0);
return 1;
}
if(strcmp("/sorry",cmdtext)==0)
{
gCommandsDisabled[playerid]==false;
return 1;
}
}