Grabgun Script Problem
#3

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
command(grabgun, playerid, params[])
{
	for(new i = 0; i < sizeof(DropInfo); i++)
	{
		if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
		{
			if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunVWorld])
			{
   				GetPlayerName(playerid, sendername, sizeof(sendername));
         		DestroyDynamicObject(DropObject[i]);
          		DropInfo[i][DropGunPosX] = 0.0;
				DropInfo[i][DropGunPosY] = 0.0;
				DropInfo[i][DropGunPosZ] = 0.0;
			//	DropInfo[i][DropGunAmmount][0] = 0;
			//	DropInfo[i][DropGunAmmount][1] = 0;
				GetPlayerName(playerid, sendername, sizeof(sendername));
				//DestroyDynamicObject(DropObject[i]);
				GivePlayerWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
				format(string, sizeof(string), "* %s picks up the weapon from the ground.", sendername);
				SendLocalMessage(playerid, string, 10.0, COLOR_PURPLE, COLOR_PURPLE);
		    	return 1;
			}
		}
	}
	return 1;
}
Since it resets the Weapon Id and Weapon Armour to 0 before the player grabs the gun, it doesn't give the player the weapon.
Thank you for your reply. Can you fix it for me please?
Reply


Messages In This Thread
Grabgun Script Problem - by RudeWorld - 19.09.2018, 00:42
Re: Grabgun Script Problem - by UFF - 19.09.2018, 03:59
Re: Grabgun Script Problem - by RudeWorld - 19.09.2018, 04:04
Re: Grabgun Script Problem - by UFF - 19.09.2018, 04:13
Re: Grabgun Script Problem - by RudeWorld - 19.09.2018, 04:30

Forum Jump:


Users browsing this thread: 2 Guest(s)