[Ajuda] Sistema incorreto
#1

Esse sistema eu sei como funciona e talz, mas quero usar parвmentros a mais nele, olha:

PHP код:
CMD:playerpp(playeridparams[])
{
    
LoginCheck(playerid);
    if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"USO: /playerpp [give / set]");
    if(
User[playerid][accountAdmin] >= 3)
    {
        if(
strcmp(params"give"true) == 0)
        {
            new 
string[150], idamount;
            if(
sscanf(params"ui"idamount)) return SendClientMessage(playeridCOLOR_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(string150"[PREMIUM POINTS] "red"%s has given %s (%d) Premium Points."GetName(playerid), GetName(id), amount);
            
SendAMessage(-1string);
            
format(string150""green"[PREMIUM POINTS] "white"You have received "grey"%d "white"premium points from an "red"admin"white"."amountUser[id][accountPP]+amount);
            
SendClientMessage(id, -1string);
            
format(string150"» You have given {%06x}%s "white"premium points of "grey"%d"white"."GetPlayerColor(id) >>> 8GetName(id), amount);
            
SendClientMessage(playerid, -1string);
            
format(string128"%s received %d Premium Points from %s."GetName(id), amountGetName(playerid));
            
Log("premium.txt"string);
            
User[id][accountPP] = amount;
        }
        else if(
strcmp(params"set"true) == 0)
        {
            new 
string[150], idamount;
            if(
sscanf(params"ui"idamount)) return SendClientMessage(playeridCOLOR_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(string150"[PREMIUM POINTS] "red"%s has given %s (%d) Premium Points."GetName(playerid), GetName(id), amount);
            
SendAMessage(-1string);
            
format(string150""green"[PREMIUM POINTS] "white"You have received "grey"%d "white"premium points from an "red"admin"white"."amountUser[id][accountPP]+amount);
            
SendClientMessage(id, -1string);
            
format(string150"» You have given {%06x}%s "white"premium points of "grey"%d"white"."GetPlayerColor(id) >>> 8GetName(id), amount);
            
SendClientMessage(playerid, -1string);
            
format(string128"%s received %d Premium Points from %s."GetName(id), amountGetName(playerid));
            
Log("premium.txt"string);
            
User[id][accountPP] += amount;
        }
        else return 
SendClientMessage(playeridCOLOR_RED"USO: /playerpp [give / set]");
    }
    return 
SendClientMessage(playerid, -1"» "red"You are not authorized to use this command.");

Eu sei que o correto й usar apenas /playerpp give ou /playerpp set! Eu sei, mas quero usar estes parвmetros aqui:
PHP код:
if(sscanf(params"ui"idamount)) return SendClientMessage(playeridCOLOR_RED"USO: /playerpp [playerid] [amount]"); 
Pois quero setar pp em um
Quote:

User[id][accountPP] = amount;

E quero acrescentar em outro
Quote:

User[id][accountPP] += amount;

Se alguйm sabe como usar mais parвmetros neste code eu agradeзo...
Reply


Messages In This Thread
Sistema incorreto - by F1N4L - 16.11.2015, 00:40
Re: Sistema incorreto - by Marlon_Lorran - 16.11.2015, 02:19
Re: Sistema incorreto - by F1N4L - 16.11.2015, 13:28
Re: Sistema incorreto - by Marlon_Lorran - 16.11.2015, 16:25
Re: Sistema incorreto - by F1N4L - 17.11.2015, 01:39
Re: Sistema incorreto - by Marlon_Lorran - 17.11.2015, 02:20

Forum Jump:


Users browsing this thread: 1 Guest(s)