Help | I want to remove the shotgun when entering cop car - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help | I want to remove the shotgun when entering cop car (
/showthread.php?tid=94819)
Help | I want to remove the shotgun when entering cop car -
RonLipel_ - 01.09.2009
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
Re: Help | I want to remove the shotgun when entering cop car -
Jefff - 01.09.2009
I think the only way is in OnPlayerEnterVehicle
Re: Help | I want to remove the shotgun when entering cop car -
chaosnz - 01.09.2009
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 ?
Re: Help | I want to remove the shotgun when entering cop car -
Lightning[SV] - 01.09.2009
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.