22.04.2012, 16:00
doesn't crash + freezes the player:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/afk", true))
{
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s gone AFK, they will not respond until they are back", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, 0x00FF22, "You've gone AFK please type /back when your back");
return 1;
}
if(!strcmp(cmdtext, "/back", true))
{
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s are back, They will now respond!", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
format(string, sizeof(string), "Welcome back, %s", pname);
SendClientMessage(playerid, 0x00FF22, string);
TogglePlayerControllable(playerid, 1);
return 1;
}
return 0;
}