17.05.2016, 15:03
PHP код:
// for origin name
new NameOriginAfk[MAX_PLAYERS][MAX_PLAYER_NAME];
// for origin name
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, NameOriginAfk);
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;
}
Код:
C:\Users\XXXX\Desktop\Serveur SAMP\gamemodes\XXX.pwn(17982) : error 048: array dimensions do not match