problem with /giveweapon name
#1

Its not working,shows unknown command

Код:
CMD:giveweapon(playerid,params[])
{
    new string[256],id,weapon,Weapon[50],pAmmo,pName[MAX_PLAYER_NAME],pName1[MAX_PLAYER_NAME];
    if(PInfo[playerid][Level] < 3)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 3 to give someone weapons.");
    if(sscanf(params,"us[50]d",id,weapon,pAmmo))
	return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /giveweapon [id] [weapon] [ammo]");
 if(!IsPlayerConnected(id))
	return SendClientMessage(playerid,STEALTH_BLUE,"That player is not connected!");
	weapon = GetWeaponModelIDFromName(Weapon);
    if(weapon < 0 || weapon > 46 || weapon == 19 || weapon == 20 || weapon == 21 || weapon == 22)
    return SendClientMessage(playerid, COLOR_INDIANRED,"This is not a valid weapon name! PLease try again");
    GivePlayerWeapon(id,weapon,pAmmo);
	GetPlayerName(playerid,pName,sizeof pName);
	format(string,sizeof(string),"Administrator %s has given you %s with %d ammo.",pName,WeaponNames[weapon],pAmmo);
    SendClientMessage(playerid,COLOR_DARKORCHID,string);
	GetPlayerName(id,pName1,sizeof pName1);
	format(string,sizeof(string),"You have given %s %s with %d ammo.",pName1,WeaponNames[weapon],pAmmo);
	SendClientMessage(playerid,COLOR_DARKORCHID,string);
	CMDMessageToAdmins(playerid,"GIVEWEAPON");
	return 1;
}
Код:
stock GetWeaponModelIDFromName(wname[])
{
    for(new i = 0; i < 48; i++) {
        if (i == 19 || i == 20 || i == 21) continue;
        if (strfind(WeaponNames[i], wname, true) != -1) {
        return i;
        }
    }
    return -1;
}
Reply


Messages In This Thread
problem with /giveweapon name - by Nabster - 09.03.2015, 07:37
AW: problem with /giveweapon name - by Kaliber - 09.03.2015, 07:47
Re: problem with /giveweapon name - by Nabster - 09.03.2015, 08:46
AW: Re: problem with /giveweapon name - by Kaliber - 09.03.2015, 08:50
Re: problem with /giveweapon name - by Nabster - 09.03.2015, 08:56
AW: Re: problem with /giveweapon name - by Kaliber - 09.03.2015, 09:04
Re: problem with /giveweapon name - by Nabster - 09.03.2015, 09:12
Re: problem with /giveweapon name - by X337 - 09.03.2015, 09:21
Re: problem with /giveweapon name - by WildWave - 09.03.2015, 09:22
Re: problem with /giveweapon name - by Nabster - 09.03.2015, 09:27

Forum Jump:


Users browsing this thread: 2 Guest(s)