Sscanf question
#1

Hello there,

I'm looking for a function that can help me by making commands like:

/give [playerid] [code] [amount]

CODES:
1: Weapon
2: Armour
3: Health

etc etc.

Anyone that can help me?

What I have for now is:

pawn Код:
CMD:give(playerid, params[])
{
    new membername, amount;
    if(sscanf(params, "uii", membername, params, amount))

    {
        SendClientMessage(playerid, COLOR_ORANGE, "[Set Player]{FFFFFF} /give[playerid] [code] [amount]");
        SendClientMessage(playerid, COLOR_GREY, "1) Health 2) Armour 3) Weapon");
        return 1;
    }

    else if(!strcmp(params, "1", true))
    {
        SetPlayerHealth(membername, amount);
        SendClientMessage(playerid, COLOR_GREEN, "Succeed");
        return 1;
    }

    else if(!strcmp(params, "2", true))
    {
        SetPlayerArmour(membername, amount);
        SendClientMessage(playerid, COLOR_GREEN, "Succeed");
        return 1;
    }

    return 1;
}
Reply


Messages In This Thread
Sscanf question - by Nourdin - 17.02.2014, 15:44
Re: Sscanf question - by Konstantinos - 17.02.2014, 15:58
Re: Sscanf question - by [EnErGyS]KING - 17.02.2014, 16:09

Forum Jump:


Users browsing this thread: 1 Guest(s)