strcmp
#4

Since you use zcmd, I assume you also have sscanf2 included.
pawn Код:
CMD:a(playerid, params[])
{
    new
        var[16];
    sscanf(params, "s[16] ", var);
    if(!strcmp(var, "weapon", true))
    {
        new
            id, weaponid, ammo;
        if(sscanf(params[strlen(var)], "udd", id, weaponid, ammo)) return SendClientMessage(playerid, WHITE, "Use: /a weapon [id] [weaponid] [ammo]");
        //if that doesn't work, try params[strlen(var) + 1]
    }
    else if(!strcmp(var, "ban", true))
    {

    }
    else SendClientMessage(playerid, WHITE, "Use: /a [weapon/ban]");
    return 1;
}
Reply


Messages In This Thread
strcmp - by Gh0sT_ - 24.01.2011, 12:16
Re: strcmp - by alpha500delta - 24.01.2011, 12:31
Re: strcmp - by Gh0sT_ - 24.01.2011, 13:12
Re: strcmp - by Stylock - 24.01.2011, 13:46
Re: strcmp - by Gh0sT_ - 24.01.2011, 14:07
Re: strcmp - by Stylock - 24.01.2011, 14:25
Re: strcmp - by JaTochNietDan - 24.01.2011, 14:37

Forum Jump:


Users browsing this thread: 4 Guest(s)