pawn Код:
//AFk
if(!strcmp(cmdtext, "/afk", true))
{
new pName[MAX_PLAYER_NAME];
new string[48];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Ahora estбs AFK. Escribe /Volver para volver a tu estado normal.");
SendClientMessage(0xFFFF00FF, string);
format(string, sizeof(string), "%s estб AFK.", pName);
SendClientMessageToAll(0xFFFF00FF, string);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid,99999999999);
return 1;
}
if(!strcmp(cmdtext, "/volver", true))
{
new pName[MAX_PLAYER_NAME];
new string[48];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Has vuelto a tu estado normal.");
SendClientMessage(0xFFFF00FF, string);
format(string, sizeof(string), "%s ha vuelto.", pName);
SendClientMessageToAll(0xFFFF00FF, string);
TogglePlayerControllable(playerid,1);
SetPlayerHealth(playerid,100);
return 1;
}