16.11.2015, 13:28
Quote:
PHP код:
Espero ter ajudado |
Printei quando vc digita o comando e vai de boa, mas quando vc digita /playerpp id GIVE amount ele nгo chama!
Olha:
Quote:
[12:17:23] [join] 646464 has joined the server (0:192.168.0.4) [12:17:39] /playerpp [playerid] [give / set] [quantidade] //chama apenas quando digita /playerpp id give [12:17:47] /playerpp [playerid] [give / set] [quantidade] //chama apenas quando digita /playerpp id give [12:17:52] /playerpp [playerid] [give / set] [quantidade] //chama apenas quando digita /playerpp id give [12:17:54] /playerpp [playerid] [give / set] [quantidade] //chama apenas quando digita /playerpp id give [12:17:55] /playerpp [playerid] [give / set] [quantidade] //chama apenas quando digita /playerpp id give |
PRINTS:
PHP код:
CMD:playerpp(playerid, params[]) {
new
otherplayer,
option[10],
amount
;
LoginCheck(playerid);
if(sscanf(params, "ds[10]d", otherplayer, option, amount))
return SendClientMessage(playerid, -1, "USO: /playerpp [playerid] [give / set] [quantidade]");
printf("/playerpp [playerid] [give / set] [quantidade]"); //PRINT
if(User[playerid][accountAdmin] >= 3) {
if(strcmp(option, "give", true) == 0) {
if(otherplayer == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "» "red"Player not connected.");
if(User[otherplayer][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(otherplayer), 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[otherplayer][accountPP]+amount);
SendClientMessage(otherplayer, -1, string);
format(string, 150, "» You have given {%06x}%s "white"premium points of "grey"%d"white".", GetPlayerColor(otherplayer) >>> 8, GetName(otherplayer), amount);
SendClientMessage(playerid, -1, string);
printf("%s", string); //PRINT
format(string, 128, "%s received %d Premium Points from %s.", GetName(otherplayer), amount, GetName(playerid));
Log("premium.txt", string);
User[otherplayer][accountPP] = amount;
}
else if(strcmp(option, "set", true) == 0) {
if(otherplayer == INVALID_PLAYER_ID)
return SendClientMessage(playerid, -1, "» "red"Player not connected.");
if(User[otherplayer][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(otherplayer), 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[otherplayer][accountPP]+amount);
SendClientMessage(otherplayer, -1, string);
format(string, 150, "» You have given {%06x}%s "white"premium points of "grey"%d"white".", GetPlayerColor(otherplayer) >>> 8, GetName(otherplayer), amount);
SendClientMessage(playerid, -1, string);
format(string, 128, "%s received %d Premium Points from %s.", GetName(otherplayer), amount, GetName(playerid));
Log("premium.txt", string);
User[otherplayer][accountPP] += amount;
}
}
return true;
}