30.11.2016, 11:07
I use this:
When i set a player adminlevel, he don't get the message from string. I get the message, he get a blank space in chat.
PHP код:
CMD:setadmin(playerid, params[])
{
new pID, value;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nu ai acces la aceasta comanda.");
else if(sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, COL_GOLD, "Foloseste: /setadmin [id] [adminlevel]");
else if(value < 0 || value > 7) return SendClientMessage(playerid, COL_GOLD, "Nivele valabile: 0-7.");
else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COL_TOM, "Jucatorul nu este conectat.");
else
{
new string[128], string1[128], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(pID, target, sizeof(target));
format(string, sizeof(string), "I-ai setat lui %s admin level %i.", target, value);
SendClientMessage(playerid, COL_GYELLOW, string);
format(string, sizeof(string), "Nivelul tau de admin a fost setat la %i de %s.", value, pName);
SendClientMessage(pID, COL_GYELLOW, string1);
PlayerInfo[pID][pAdmin] = value;
}
return 1;
}