/giveweapon [weapon name]
#1

hey guys....

i need to ask you how to make /giveweapon [playerid] [weapon name/ID] [ammo]
i have it in my script as '/giveweapon [playerid] [id] [ammo]

i just wanna change it to
ID/Weapon name
Reply
#2

Try this...

Код:
CMD:giveweapon(playerid, params[])
{
	new playerb, gunid, ammo, string[128];
   	if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(sscanf(params, "uii", playerb, gunid, ammo))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid] [gunid] [ammo]");
		SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
		SendClientMessage(playerid, COLOR_GREY, "1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
		SendClientMessage(playerid, COLOR_GREY, "10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
		SendClientMessage(playerid, COLOR_GREY, "17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Desert Eagle 25: Shotgun");
		SendClientMessage(playerid, COLOR_GREY, "26: Sawnoff Shotgun 27: SPAS-12 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Rifle");
		SendClientMessage(playerid, COLOR_GREY, "25: Shotgun 34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
		SendClientMessage(playerid, COLOR_GREY, "40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
		SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");

		return 1;
	}
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	if(gunid < 0 || gunid > 46 || gunid == 19 || gunid == 20 || gunid == 21) return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon id.");
	GiveDodWeapon(playerb, gunid, ammo);
	format(string, sizeof(string), " You have given %s a %s with %d ammo.", RPN(playerb), RWN(gunid), ammo);
	SendClientMessage(playerid, COLOR_WHITE, string);
	format(string, sizeof(string), " Administrator %s has given you a %s with %d ammo.", RPN(playerid), RWN(gunid), ammo);
	SendClientMessage(playerb, COLOR_WHITE, string);
	return 1;
}
Reply
#3

Quote:
Originally Posted by RalphHaro
Посмотреть сообщение
Try this...

Код:
CMD:giveweapon(playerid, params[])
{
	new playerb, gunid, ammo, string[128];
   	if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(sscanf(params, "uii", playerb, gunid, ammo))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid] [gunid] [ammo]");
		SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
		SendClientMessage(playerid, COLOR_GREY, "1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
		SendClientMessage(playerid, COLOR_GREY, "10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
		SendClientMessage(playerid, COLOR_GREY, "17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Desert Eagle 25: Shotgun");
		SendClientMessage(playerid, COLOR_GREY, "26: Sawnoff Shotgun 27: SPAS-12 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Rifle");
		SendClientMessage(playerid, COLOR_GREY, "25: Shotgun 34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
		SendClientMessage(playerid, COLOR_GREY, "40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
		SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");

		return 1;
	}
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
	if(gunid < 0 || gunid > 46 || gunid == 19 || gunid == 20 || gunid == 21) return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon id.");
	GiveDodWeapon(playerb, gunid, ammo);
	format(string, sizeof(string), " You have given %s a %s with %d ammo.", RPN(playerb), RWN(gunid), ammo);
	SendClientMessage(playerid, COLOR_WHITE, string);
	format(string, sizeof(string), " Administrator %s has given you a %s with %d ammo.", RPN(playerid), RWN(gunid), ammo);
	SendClientMessage(playerb, COLOR_WHITE, string);
	return 1;
}
i think my quistion is CLEAR ENOUGH

i said that i want /giveweapon [weapon name/id]

and i have like this as you gave me so i want just the name and id not a list of weapon name and id -.-
Reply
#4

If you're asking for assistance on how to make it, read up stuff like https://sampwiki.blast.hk/wiki/GivePlayerWeapon

But if you just want us to make it, which isn't best for learning, post it in a request thread https://sampforum.blast.hk/showthread.php?tid=413556
Reply
#5

Quote:
Originally Posted by GoldZoroGrab
Посмотреть сообщение
i think my quistion is CLEAR ENOUGH

i said that i want /giveweapon [weapon name/id]

and i have like this as you gave me so i want just the name and id not a list of weapon name and id -.-
I'm sorry to be rude here, but you're in the HELP section....


NO one has to help you, so be greatfull for the fact that someone actually did.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)