Can someone help me sort this Weapon system out | ++
#3

Quote:
Originally Posted by legho
Посмотреть сообщение
Can someone help me sort this out so i can do
GiveWeaponToPlayer(playerid,"9mm") or something like this?

Please help im actually begging! + Rep

Код:
stock GiveWeaponToPlayer(playerid,WeaponName[])
{
	// Pistols
	else if (!strcmp(WeaponName, "9mm", true && PlayerInfo[playerid][pRank] >=1)) // Rank 1+
	{
		GivePlayerWeapon(playerid,22,20); //9mm
	}
 	else if (!strcmp(WeaponName, "Silenced 9mm", true && PlayerInfo[playerid][pRank] >=5)
	{
		GivePlayerWeapon(playerid,23,20); // Silenced 9mm
	}
	else if (!strcmp(WeaponName, "Deagle", true && PlayerInfo[playerid][pRank] >=5)
	{
		GivePlayerWeapon(playerid,24,20); // Deagle
	}
	//Automatics
	else if (!strcmp(WeaponName, "Micro SMG", true && PlayerInfo[playerid][pRank] >=7)
	{
		GivePlayerWeapon(playerid,28,100); // Micro SMG
	}
	else if (!strcmp(WeaponName, "Tec 9", true && PlayerInfo[playerid][pRank] >=18)
	{
		GivePlayerWeapon(playerid,32,100); // tec9
	}
	else if (!strcmp(WeaponName, "mp5", true && PlayerInfo[playerid][pRank] >=29)
	{
		GivePlayerWeapon(playerid,29,100); // mp5
	}
	else if (!strcmp(WeaponName, "ak47", true && PlayerInfo[playerid][pRank] >=35)
	{
		GivePlayerWeapon(playerid,30,100); // ak47
	}
	else if (!strcmp(WeaponName, "m4", true && PlayerInfo[playerid][pRank] >=42)
	{
		GivePlayerWeapon(playerid,31,100); // m4
	}
	//Shotguns
	else if (!strcmp(WeaponName, "Barrel Shotgun", true && PlayerInfo[playerid][pRank] >=7)
	{
		GivePlayerWeapon(playerid,25,30); //barrel shotgun
	}
	else if (!strcmp(WeaponName, "Combat Shotgun", true && PlayerInfo[playerid][pRank] >=19)
	{
		GivePlayerWeapon(playerid,27,30); // combat shotgun
	}
	else if (!strcmp(WeaponName, "Sawnoff Shotgun", true && PlayerInfo[playerid][pRank] >=32)
	{
		GivePlayerWeapon(playerid,26,30); // sawnoff
	}
	//Rifles
	else if (!strcmp(WeaponName, "Country Rifle", true && PlayerInfo[playerid][pRank] >=9)
	{
		GivePlayerWeapon(playerid,33,30); // country rifle
	}
	else if (!strcmp(WeaponName, "Sniper Rifle", true && PlayerInfo[playerid][pRank] >=12)
	{
		GivePlayerWeapon(playerid,34,30); // sniper rifle
	}
	// Heavy Duty
	else if (!strcmp(WeaponName, "Flamethrower", true && PlayerInfo[playerid][pRank] >=19)
	{
		GivePlayerWeapon(playerid,37,15); // flamethrower
	}
	else if (!strcmp(WeaponName, "RPG", true && PlayerInfo[playerid][pRank] >=26)
	{
		GivePlayerWeapon(playerid,35,2); // rpg
	}
	// Miscellaneous
	else if (!strcmp(WeaponName, "Grenade", true && PlayerInfo[playerid][pRank] >=3)
	{
		GivePlayerWeapon(playerid,16,2); // grenade
	}
	else if (!strcmp(WeaponName, "Tear Gas", true && PlayerInfo[playerid][pRank] >=6)
	{
		GivePlayerWeapon(playerid,17,2); // tear gas
	}
	else if (!strcmp(WeaponName, "Molotov Cocktail", true && PlayerInfo[playerid][pRank] >=9)
	{
		GivePlayerWeapon(playerid,18,2); // molotov cocktail
	}
	return 1;
}
So your checking if they have that weapon equipped and are above a certain level yes?
Reply


Messages In This Thread
Can someone help me sort this Weapon system out | ++ - by legho - 11.01.2012, 20:13
Re: Can someone help me sort this Weapon system out | ++ - by Vince - 11.01.2012, 20:17
Re: Can someone help me sort this Weapon system out | ++ - by Rokzlive - 11.01.2012, 20:18
Re: Can someone help me sort this Weapon system out | ++ - by Rokzlive - 11.01.2012, 20:20
Re: Can someone help me sort this Weapon system out | ++ - by legho - 11.01.2012, 23:06
Re: Can someone help me sort this Weapon system out | ++ - by legho - 11.01.2012, 23:55

Forum Jump:


Users browsing this thread: 1 Guest(s)