cmd no work
#3

Advanced one >>
pawn Код:
CMD:gun(playerid,params[])
{
new WeaponName[50];
if(sscanf(params,"s[50]"WeaponName))  return SendClientMessage(playerid, -1, "[USAGE] /Gun [Gun-Name]");
GivePlayerWeapon(playerid, GetWeaponModelIDFromName(WeaponName), 10000);
return 1;
}
And add this.
pawn Код:
stock GetWeaponModelIDFromName(wname[])
{
    for(new i = 0; i < 48; i++) {
        if (i == 19 || i == 20 || i == 21) continue;
        if (strfind(aWeaponNames[i], wname, true) != -1) {
            return i;
        }
    }
    return -1;
}
Reply


Messages In This Thread
cmd no work - by thefatshizms - 07.06.2012, 21:32
Re: cmd no work - by zDevon - 07.06.2012, 22:25
Re: cmd no work - by Littlehelper - 07.06.2012, 22:28
Re: cmd no work - by admantis - 07.06.2012, 22:29
Re: cmd no work - by Littlehelper - 07.06.2012, 22:37

Forum Jump:


Users browsing this thread: 4 Guest(s)