Help sscanf2 and optional variables
#1

My idea it Create variable UN with an optional second command. Command left:

pawn Код:
CMD:comando(playerid, params[])
{
    if(sscanf(params, "s[32]I(5)", params[0], params[1]))
    {

        SendClientMessage(playerid, -1, "USO: /comando [Opciуn] ");
        SendClientMessage(playerid, -1, "Primera, Segunda, Tercera, Cuarta");
        return 1;
    }
    if(strcmp(params[0],"primera",true) == 0)
    {
        if(params[1] == 5) return       SendClientMessage(playerid, -1, "/comando  primera [Cantidad]");
        SendClientMessage(playerid, -1, "Crear");
   
    }
    else if(strcmp(params[0],"segunda",true) == 0)
    {

        SendClientMessage(playerid, -1, "segunda");
    }
    else if(strcmp(params[0],"tercera",true) == 0)
    {

    }
    else if(strcmp(params[0],"cuarta",true) == 0)
    {

    }  
    return 1;
}
The idea is that by using / first command will require the second parameter but use / second command no.
I hope I made myself clear.

+1 I solve it.

sorry my bad Inglйs
Reply


Messages In This Thread
Help sscanf2 and optional variables - by Jose_grana - 27.10.2016, 11:48
Re: Help sscanf2 and optional variables - by Vince - 27.10.2016, 11:56
Respuesta: Help sscanf2 and optional variables - by Jose_grana - 30.10.2016, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)