How do I make a 'mullti' cmd?
#3

I downloaded another GM wthat uses zcmd and sscanf to see if I could get a tip from there.
pawn Код:
CMD:sign(playerid, params[])
{
    new
    give[5];

    if(sscanf(params, "s[5]", give)) return SendClientMessage(playerid, COLOR_GREY, "[Usage]: /sign [1-4]");
    if(!strcmp(give, "1", true))
    {
        ApplyAnimation(playerid, "GHANDS", "gsign2", 4.1, 1, 1, 1, 1, 1, 1);
    }
    else if(!strcmp(give, "2", true))
    {
        ApplyAnimation(playerid, "GHANDS", "gsign3", 4.1, 1, 1, 1, 1, 1, 1);
    }
    else if(!strcmp(give, "3", true))
    {
        ApplyAnimation(playerid, "GHANDS", "gsign5", 4.1, 1, 1, 1, 1, 1, 1);
    }
    else if(!strcmp(give, "4", true))
    {
        ApplyAnimation(playerid, "GHANDS", "gsign4LH", 4.1, 1, 1, 1, 1, 1, 1);
    }
    return 1;
}
Is this really how you do it?? Then why do you use zcmd and sscanf if you still gonna use strcmp in the command?? Or am I missing something??

EDIT: Saw what you said now and understand why strcmp is being used. Thanks!
Reply


Messages In This Thread
How do I make a 'mullti' cmd? - by Don_Cage - 02.02.2014, 02:18
Re: How do I make a 'mullti' cmd? - by CuervO - 02.02.2014, 03:05
Re: How do I make a 'mullti' cmd? - by Don_Cage - 02.02.2014, 03:10
Re: How do I make a 'mullti' cmd? - by CuervO - 02.02.2014, 03:16
Re: How do I make a 'mullti' cmd? - by Don_Cage - 02.02.2014, 03:40

Forum Jump:


Users browsing this thread: 2 Guest(s)