16.11.2015, 00:40
Esse sistema eu sei como funciona e talz, mas quero usar parвmentros a mais nele, olha:
Eu sei que o correto й usar apenas /playerpp give ou /playerpp set! Eu sei, mas quero usar estes parвmetros aqui:
Pois quero setar pp em um
E quero acrescentar em outro
Se alguйm sabe como usar mais parвmetros neste code eu agradeзo...
PHP код:
CMD:playerpp(playerid, params[])
{
LoginCheck(playerid);
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USO: /playerpp [give / set]");
if(User[playerid][accountAdmin] >= 3)
{
if(strcmp(params, "give", true) == 0)
{
new string[150], id, amount;
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "USO: /playerpp [playerid] [amount]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "» "red"Player not connected.");
if(User[id][accountLogged] == false) return SendClientMessage(playerid, -1, "» "red"Player not logged in.");
format(string, 150, "[PREMIUM POINTS] "red"%s has given %s (%d) Premium Points.", GetName(playerid), GetName(id), amount);
SendAMessage(-1, string);
format(string, 150, ""green"[PREMIUM POINTS] "white"You have received "grey"%d "white"premium points from an "red"admin"white".", amount, User[id][accountPP]+amount);
SendClientMessage(id, -1, string);
format(string, 150, "» You have given {%06x}%s "white"premium points of "grey"%d"white".", GetPlayerColor(id) >>> 8, GetName(id), amount);
SendClientMessage(playerid, -1, string);
format(string, 128, "%s received %d Premium Points from %s.", GetName(id), amount, GetName(playerid));
Log("premium.txt", string);
User[id][accountPP] = amount;
}
else if(strcmp(params, "set", true) == 0)
{
new string[150], id, amount;
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "USO: /playerpp [playerid] [amount]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "» "red"Player not connected.");
if(User[id][accountLogged] == false) return SendClientMessage(playerid, -1, "» "red"Player not logged in.");
format(string, 150, "[PREMIUM POINTS] "red"%s has given %s (%d) Premium Points.", GetName(playerid), GetName(id), amount);
SendAMessage(-1, string);
format(string, 150, ""green"[PREMIUM POINTS] "white"You have received "grey"%d "white"premium points from an "red"admin"white".", amount, User[id][accountPP]+amount);
SendClientMessage(id, -1, string);
format(string, 150, "» You have given {%06x}%s "white"premium points of "grey"%d"white".", GetPlayerColor(id) >>> 8, GetName(id), amount);
SendClientMessage(playerid, -1, string);
format(string, 128, "%s received %d Premium Points from %s.", GetName(id), amount, GetName(playerid));
Log("premium.txt", string);
User[id][accountPP] += amount;
}
else return SendClientMessage(playerid, COLOR_RED, "USO: /playerpp [give / set]");
}
return SendClientMessage(playerid, -1, "» "red"You are not authorized to use this command.");
}
PHP код:
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "USO: /playerpp [playerid] [amount]");
Quote:
User[id][accountPP] = amount; |
Quote:
User[id][accountPP] += amount; |