Sscanf question
#2

pawn Код:
CMD:give(playerid, params[])
{
    new membername, code, amount;
    if(sscanf(params, "uii", membername, code, amount))
    {
        SendClientMessage(playerid, COLOR_ORANGE, "[Set Player]{FFFFFF} /give[playerid] [code] [amount]");
        SendClientMessage(playerid, COLOR_GREY, "1) Health 2) Armour 3) Weapon");
        return 1;
    }
    if(!IsPlayerConnected(membername)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player");
   
    switch (code)
    {
        case 1:
        {
            SetPlayerHealth(membername, amount);
            SendClientMessage(playerid, COLOR_GREEN, "Succeed");
        }
        case 2:
        {
            SetPlayerArmour(membername, amount);
            SendClientMessage(playerid, COLOR_GREEN, "Succeed");
        }
        case 3:
        {
            // weapon..
        }
        default: SendClientMessage(playerid, COLOR_GREY, "Invalid option -> 1) Health 2) Armour 3) Weapon");
    }
    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)