17.05.2016, 14:51
I have a code when the player do /afk he can't move and change is name to xxxx[afk]
but i hava a another code /stopafk but i can't remove the [afk]
there is the code
but i hava a another code /stopafk but i can't remove the [afk]
there is the code
Код:
COMMAND:afk(playerid, params[])
{
SendAdminText(playerid, "/afk", params);
if (APlayerData[playerid][LoggedIn] == false) return 0;
new Name[24], string[128], AFKName[25];
TogglePlayerControllable(playerid,0);
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(playerid, AFKName, sizeof(AFKName));
format(string, sizeof(string),"%s[afk]", AFKName);
SetPlayerName(playerid, string);
format(string, sizeof(string),"Le joueur %s c'est mis afk !", Name);
SendClientMessageToAll(0xFFFFFF, string);
// message afk
SendClientMessage(playerid,0xFFFFFFFF, "Vous etes maintenant afk !");
return 1;
}
COMMAND:stopafk(playerid, params[])
{
SendAdminText(playerid, "/stopafk", params);
if (APlayerData[playerid][LoggedIn] == false) return 0;
new Name[24], string[128], AFKName[25];
TogglePlayerControllable(playerid,1);
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(playerid, AFKName, sizeof(AFKName));
format(string, sizeof(string),"%s", AFKName);
SetPlayerName(playerid, string);
format(string, sizeof(string),"Le joueur %s est de retour !", Name);
SendClientMessageToAll(0xFFFFFF, string);
// message afk
SendClientMessage(playerid,0xFFFFFFFF, "Vous etes maintenant de retour !");
return 1;
}


