Disable get weapons/ armour from enforcer etc
#1

Hello

I want to disalbe the system that when you enter an enforcer you get a shotgun and armour.
Like on stunt servers this isnt very handy

how can i do that?
Reply
#2

Just remove the code.

Look in OnPlayerEnterVehicle and look for the vehicle ID 427.

Look for a code similar to this one:

Код:
if(IsPlayerInVehicle(playerid, 427))
{
  GivePlayerWeapon(playerid, 25, 100);
  SetPlayerArmour(playerid, 100.0);
}
return 1;
Reply
#3

Quote:
Originally Posted by BigPoncho
Just remove the code.

Look in OnPlayerEnterVehicle and look for the vehicle ID 427.

Look for a code similar to this one:

Код:
if(IsPlayerInVehicle(playerid, 427))
{
  GivePlayerWeapon(playerid, 25, 100);
  SetPlayerArmour(playerid, 100.0);
}
return 1;
And if the player had 50 armor before?..
Would be better with a timer, because the public OnPlayerEnterVehicle gets called when a player presses f/enter near the vehicle, doesn't matter if he sits in the car or not.
Reply
#4

My script does not have that code!
Reply
#5

Yeah it's from Single Player, but you can disable it:

Код:
// Add on top of the script
new Float:StoreArmour[MAX_PLAYERS];
new StoreWeapons[MAX_PLAYERS][13][2];
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new Model = GetVehicleModel(vehicleid);
	if(Model == 427 && !ispassenger)
	{
		for (new i = 0; i < 13; i++)
		{
		  GetPlayerWeaponData(playerid, i, StoreWeapons[playerid][i][0], StoreWeapons[playerid][i][1]);
		}
	  GetPlayerArmour(playerid, StoreArmour[playerid]);
	}
	return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
	  new Model = GetVehicleModel(GetPlayerVehicleID(playerid));
	  if(Model == 427)
	  {
			ResetPlayerWeapons(playerid);
			for (new i = 0; i < 13; i++)
			{
				GivePlayerWeapon(playerid, StoreWeapons[playerid][i][0], StoreWeapons[playerid][i][1]);
			}
			SetPlayerArmour(playerid, StoreArmour[playerid]);
		}
	}
	return 1;
}
Edit: Edited the code, it's untested but should work
Reply
#6

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by BigPoncho
Just remove the code.

Look in OnPlayerEnterVehicle and look for the vehicle ID 427.

Look for a code similar to this one:

Код:
if(IsPlayerInVehicle(playerid, 427))
{
  GivePlayerWeapon(playerid, 25, 100);
  SetPlayerArmour(playerid, 100.0);
}
return 1;
And if the player had 50 armor before?..
It sets armour to 100 not give u another 100
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)