05.03.2011, 13:33
So first we need to know that public OnPlayerCommandText like everyone knows that there are the commands
Do this:
AFK:
BACK:
There you go it's done :P
Do this:
AFK:
Код:
if(strcmp(cmdtext, "/afk", true) == 0) { TogglePlayerControllable(playerid, 0); new string [128]; new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(string,sizeof string,"%s is afk now (Away From Keyboard).",pName); SendClientMessageToAll(green, string); return 1; }
Код:
if(strcmp(cmdtext, "/back", true) == 0) { new string [128]; new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(string,sizeof string,"%s is back now (Back To KeyBoard).",pName); SendClientMessageToAll(lightblue, string); TogglePlayerControllable(playerid, 1); return 1; }