String combination in code
#4

Oh, now I understand what you want. I think something like this should work
pawn Код:
new weap[10/*how many weapon ids*/] = {
14, 23, 13, 64, 45, 46, 7, 28, 39, 31 //weapon id's
};

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/weapon", true, 5)==0)
    {
        if(!strlen(cmdtext[6]))
        {
            SendClientMessage(playerid, 0xFF0000AA, "Use: /weapon [id]");
            return 1;
        }
        new ID = strval(cmdtext[8]);
        GivePlayerWeapon(playerid, weap[ID], 500);
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
String combination in code - by pascallj - 27.06.2009, 20:49
Re: String combination in code - by dice7 - 27.06.2009, 20:54
Re: String combination in code - by pascallj - 27.06.2009, 20:57
Re: String combination in code - by dice7 - 27.06.2009, 21:24
Re: String combination in code - by pascallj - 28.06.2009, 13:31
Re: String combination in code - by pascallj - 28.06.2009, 18:02

Forum Jump:


Users browsing this thread: 4 Guest(s)