/giveallweapon problem [Weapon Name]
#2

Try with:

PHP код:
new GunName[47][20] = 
{
    
"Fist","Brass Knuckles","Golf Club","Nightstick","Knife","Basebal Bat","Shovel","Pool Cue","Katana","Chainsaw","Double-ended Dildo","Dildo","Vibrator",
    
"Silver Vibrator","Flowers","Cane","Grenade","Tear Gas","Molotv Cocktail","?","?","?","9mm","Silenced 9mm","Desert Eagle","Shotgun","Sawnoff-Shotgun",
    
"Combat Shotgun","Micro-SMG","MP5","Ak-47","M4","Tec9","Country Rifle","Sniper Rifle","RPG","HS-RPG","Flame-Thrower","Minigun","Satchel Charge","Detonator",
    
"Spray Can","Fire Extinguisher","Camera","Night Goggles","Thermal Goggles","Parachute"
};
// Example of use:
CMD:mygun(playerid)
{
    new 
text[48];
    
format(text,sizeof text,"You've got a nice: {FFFFFF}%s",GunName[GetPlayerWeapon(playerid)]);
    
SendClientMessage(playerid,0xFFDD22FF,text);
    return 
1;

Your command should be:

PHP код:
CMD:giveallweapons(playeridparams[])
{
new 
weaponid,model[50],ammo;
if(
pInfo[playerid][Admin]<4) return SendClientMessage(playeridRED"ERROR: You are not authorized to use this command");
if(
sscanf(params"si"modelammo)) return SendClientMessage(playeridRED"ERROR: /giveallweapon [weaponid] [ammo]");
weaponid GetWeaponNameID(model);
if(
weaponid 47 || weaponid 1) return SendClientMessage (playeridRED"ERROR: Invailed weapon name");
foreach(
Player,i)
{
GivePlayerWeapon(iweaponidammo);
PlayerPlaySound(i1057,0.0,0.0,0.0);
}
format(strSOS"Administrator %s has given all players weapon [%s] with [%i] ammo "pInfo[playerid][Name], GunName[weaponid], ammo);
SendClientMessageToAll(BLUEstr);
format(strSOS"Admin: %s has used command GIVEALLWEAPONS"pInfo[playerid][Name]);
SendCMDAdmin(BLUEstr);
return 
1;

Font: arakuta
https://sampforum.blast.hk/showthread.php?tid=435457
Reply


Messages In This Thread
/giveallweapon problem [Weapon Name] - by ahmedraed - 04.11.2016, 17:13
Respuesta: /giveallweapon problem [Weapon Name] - by Ner0x96 - 04.11.2016, 17:18
Re: /giveallweapon problem [Weapon Name] - by Konstantinos - 04.11.2016, 17:27
Re: /giveallweapon problem [Weapon Name] - by ahmedraed - 04.11.2016, 17:48

Forum Jump:


Users browsing this thread: 1 Guest(s)