2 sscanf in same command ?
#1

How can i do this kind of a command .. for some reason the printf isn't called but the showsyntax is.


pawn Код:
CMD:aevent(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 3) return 1;
    new option[256];
    if(sscanf(params, "s[256]", option))
    {
        ShowSyntax(playerid, "/aevent <Option>");
        SCM(playerid, COLOR_SERVER, "Options: {FFFFFF}Heal, Armour, GiveGun, Disarm, Respawn,(Un)Freeze, Repair, Nos");
        return 1;
    }
        if(strcmp(option,"heal",true) == 0)
        {
                new amount;
        if(sscanf(params, "i", amount)) return ShowSyntax(playerid, "/aevent heal <Value>");
        printf("Chemat");
                foreach(new i : Player)
        {
            printf("intrat");
            if (FindNear(60.0, playerid, i))
            {

                SetPlayerHealth(i, amount);
                format(strglobal, sizeof(strglobal), "(Admin Event) {FFFFFF}%s set your health to %d.0", GetName(playerid), amount);
                SCM(i, COLOR_LIGHTRED, strglobal);
            }
        }
        }
    return 1;
}
Reply


Messages In This Thread
2 sscanf in same command ? - by Metharon - 02.06.2016, 11:16
Re: 2 sscanf in same command ? - by Konstantinos - 02.06.2016, 12:16

Forum Jump:


Users browsing this thread: 1 Guest(s)