PHP код:
CMD:setplayer(playerid, params[])
{
new id, set[16], value, string[128];
if (PlayerInfo[playerid][pAdmin] < SubDonoAdminLevel)
return SendClientMessage(playerid, -1, "{FF0000}[ERRO] {FFFFFF}Voce nao tem permissao para utilizar esse comando");
if (sscanf(params, "us[16]i", id, set, value))
{
SendClientMessage(playerid, -1, "Uso: /setplayer [id] [atributo] [valor]");
SendClientMessage(playerid, -1, "Atributos Validos: dinheiro - score - veiculo");
return 1;
}
if (id == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "{FF0000}[ERRO] {FFFFFF}Player invalido!");
if (!strcmp(set, "dinheiro", true))
{
PlayerInfo[id][pDinheiro] = value;
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "O Admin %s setou %d em sua conta bancaria!", name, value);
SendClientMessage(id, -1, string);
GetPlayerName(id, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Voce setou %d na conta de %s!", value, name);
SendClientMessage(playerid, -1, string);
}
else if (!strcmp(set, "score", true))
{
// ...
}
return 1;
}