27.06.2009, 21:24
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;
}