Is this possible?
#9

Humm... The most similar thing you can do is create an enum like:
pawn Код:
enum sInfo
{
    enum1
    enum2
    enum3
    enum4
    enum5
}
new ServerInfo[sInfo];
And now, you can create command like:
pawn Код:
CMD:setenum1(playerid, params[])
{
    new value;
    if(!sscanf(params, "d", value))
    {
        if(value == 1 && 5)
        {
            ServerInfo[enum1] = value;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "Avaliable Values: 1, 2, 3, 4, 5.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setenum1 [Value(1-5)]");
}
CMD:setenum2(playerid, params[])
{
    new value;
    if(!sscanf(params, "d", value))
    {
        if(value == 1 && 5)
        {
            ServerInfo[enum2] = value;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "Avaliable Values: 1, 2, 3, 4, 5.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setenum2 [Value(1-5)]");
}
CMD:setenum3(playerid, params[])
{
    new value;
    if(!sscanf(params, "d", value))
    {
        if(value == 1 && 5)
        {
            ServerInfo[enum3] = value;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "Avaliable Values: 1, 2, 3, 4, 5.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setenum3 [Value(1-5)]");
}
CMD:setenum4(playerid, params[])
{
    new value;
    if(!sscanf(params, "d", value))
    {
        if(value == 1 && 5)
        {
            ServerInfo[enum4] = value;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "Avaliable Values: 1, 2, 3, 4, 5.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setenum4 [Value(1-5)]");
}
CMD:setenum5(playerid, params[])
{
    new value;
    if(!sscanf(params, "d", value))
    {
        if(value == 1 && 5)
        {
            ServerInfo[enum5] = value;
        }
        else return SendClientMessage(playerid, 0xFFFFFFFF, "Avaliable Values: 1, 2, 3, 4, 5.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setenum5 [Value(1-5)]");
}
Reply


Messages In This Thread
Is this possible? - by oliverrud - 16.02.2012, 19:58
Re: Is this possible? - by devil77771 - 16.02.2012, 20:09
Re: Is this possible? - by [MG]Dimi - 16.02.2012, 21:19
Re: Is this possible? - by oliverrud - 16.02.2012, 23:30
Re: Is this possible? - by Toreno - 16.02.2012, 23:35
Re: Is this possible? - by oliverrud - 16.02.2012, 23:42
Re: Is this possible? - by Tannz0rz - 16.02.2012, 23:50
Re: Is this possible? - by [MG]Dimi - 17.02.2012, 10:01
Re : Is this possible? - by ricardo178 - 17.02.2012, 10:26
Re: Is this possible? - by milanosie - 17.02.2012, 11:03

Forum Jump:


Users browsing this thread: 1 Guest(s)