Help | I want to remove the shotgun when entering cop car
#1

I tried this:
Код:
  if(newstate == PLAYER_STATE_DRIVER)
	{
	  if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 523 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 597 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 599)
	  {
			new weapons[13][2];
			for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
			ResetPlayerWeapons(playerid);
			for (new i = 0; i < 13; i++) if(weapons[i][0] != 0 && weapons[i][1] > 0 && weapons[i][0] != 25) GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
	  }
In:
public OnPlayerStateChange(playerid, newstate, oldstate)
if player vehicle is a cop car..

But nothing happens :S

Can someone help me?
Tnx
Reply
#2

I think the only way is in OnPlayerEnterVehicle
Reply
#3

What about something like...

now dont quote me on this as im still learning how to script...but...

where the "public OnPlayerExitVehicle(playerid, vehicleid)" is put a function under it to get the modelid of the police vehicles then set it to disarm a player ?

Reply
#4

The player gets the shotgun just after they exit the vehicle so you need to reset weapons a couple of seconds after they exit vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)