SA-MP Forums Archive
[HELP] Veh Locks Not Working!! - 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] Veh Locks Not Working!! (/showthread.php?tid=124141)



[HELP] Veh Locks Not Working!! - will_92 - 29.01.2010

I am trying to get all these veh locked depending on your prof levels but doesn't seem to be working instead it works once the player gets killed and then respawns but then it locks for everyone no matter what your profession level is... Can someone help please.. thanks


Here's my code btw:

Quote:

Onplayerspawn

if (Infantry[playerid] == 1)

{
//planes(playerid);
SetVehicleParamsForPlayer(hunterc1,playerid,0,1);
SetVehicleParamsForPlayer(hunterc2,playerid,0,1);
SetVehicleParamsForPlayer(hunterc3,playerid,0,1);
SetVehicleParamsForPlayer(hunterc4,playerid,0,1);
SetVehicleParamsForPlayer(hydrachin1,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin2,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin3,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin4,playerid,0,1) ;
SetVehicleParamsForPlayer(Rus1,playerid,0,1);
SetVehicleParamsForPlayer(Rus2,playerid,0,1);
SetVehicleParamsForPlayer(Rus3,playerid,0,1);
SetVehicleParamsForPlayer(Rus4,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus1,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus2,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa1,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa2,playerid,0,1);

GivePlayerWeapon(playerid,31,500);
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,44,1);
}


if (Pilot[playerid] == 1)
{
//tanks(playerid);
SetVehicleParamsForPlayer(hunterc1,playerid,0,0);
SetVehicleParamsForPlayer(hunterc2,playerid,0,0);
SetVehicleParamsForPlayer(hunterc3,playerid,0,0);
SetVehicleParamsForPlayer(hunterc4,playerid,0,0);
SetVehicleParamsForPlayer(hydrachin1,playerid,0,0) ;
SetVehicleParamsForPlayer(hydrachin2,playerid,0,0) ;
SetVehicleParamsForPlayer(hydrachin3,playerid,0,0) ;
SetVehicleParamsForPlayer(hydrachin4,playerid,0,0) ;
SetVehicleParamsForPlayer(Rus1,playerid,0,0);
SetVehicleParamsForPlayer(Rus2,playerid,0,0);
SetVehicleParamsForPlayer(Rus3,playerid,0,0);
SetVehicleParamsForPlayer(Rus4,playerid,0,0);
SetVehicleParamsForPlayer(hydrarus1,playerid,0,0);
SetVehicleParamsForPlayer(hydrarus2,playerid,0,0);
SetVehicleParamsForPlayer(hydrausa1,playerid,0,0);
SetVehicleParamsForPlayer(hydrausa2,playerid,0,0);
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,29,100);
GivePlayerWeapon(playerid,46,1);
GivePlayerWeapon(playerid,4,1);
}
if (Sniper[playerid] == 1)
{
//planes(playerid);
//tanks(playerid);
SetVehicleParamsForPlayer(hunterc1,playerid,0,1);
SetVehicleParamsForPlayer(hunterc2,playerid,0,1);
SetVehicleParamsForPlayer(hunterc3,playerid,0,1);
SetVehicleParamsForPlayer(hunterc4,playerid,0,1);
SetVehicleParamsForPlayer(hydrachin1,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin2,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin3,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin4,playerid,0,1) ;
SetVehicleParamsForPlayer(Rus1,playerid,0,1);
SetVehicleParamsForPlayer(Rus2,playerid,0,1);
SetVehicleParamsForPlayer(Rus3,playerid,0,1);
SetVehicleParamsForPlayer(Rus4,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus1,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus2,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa1,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa2,playerid,0,1);
GivePlayerWeapon(playerid,34,100);
GivePlayerWeapon(playerid,23,100);
GivePlayerWeapon(playerid,45,1);

}
if (Anti[playerid] == 1)
{
//planes(playerid);
SetVehicleParamsForPlayer(hunterc1,playerid,0,1);
SetVehicleParamsForPlayer(hunterc2,playerid,0,1);
SetVehicleParamsForPlayer(hunterc3,playerid,0,1);
SetVehicleParamsForPlayer(hunterc4,playerid,0,1);
SetVehicleParamsForPlayer(hydrachin1,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin2,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin3,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin4,playerid,0,1) ;
SetVehicleParamsForPlayer(Rus1,playerid,0,1);
SetVehicleParamsForPlayer(Rus2,playerid,0,1);
SetVehicleParamsForPlayer(Rus3,playerid,0,1);
SetVehicleParamsForPlayer(Rus4,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus1,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus2,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa1,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa2,playerid,0,1);
SendClientMessage(playerid,green,"Anti-Vehicle commands: /plant /detonate");
GivePlayerWeapon(playerid,16,50);
GivePlayerWeapon(playerid,25,60);
GivePlayerWeapon(playerid,35,2);
}
if (Medic[playerid] == 1)
{
//planes(playerid);
//tanks(playerid);
SetVehicleParamsForPlayer(hunterc1,playerid,0,1);
SetVehicleParamsForPlayer(hunterc2,playerid,0,1);
SetVehicleParamsForPlayer(hunterc3,playerid,0,1);
SetVehicleParamsForPlayer(hunterc4,playerid,0,1);
SetVehicleParamsForPlayer(hydrachin1,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin2,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin3,playerid,0,1) ;
SetVehicleParamsForPlayer(hydrachin4,playerid,0,1) ;
SetVehicleParamsForPlayer(Rus1,playerid,0,1);
SetVehicleParamsForPlayer(Rus2,playerid,0,1);
SetVehicleParamsForPlayer(Rus3,playerid,0,1);
SetVehicleParamsForPlayer(Rus4,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus1,playerid,0,1);
SetVehicleParamsForPlayer(hydrarus2,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa1,playerid,0,1);
SetVehicleParamsForPlayer(hydrausa2,playerid,0,1);
SendClientMessage(playerid,green,"Medic commands : /heal");
GivePlayerWeapon(playerid,22,100);
}




Re: [HELP] Veh Locks Not Working!! - mansonh - 29.01.2010

https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Quote:

Note: From 0.3 you will have to re-apply this function when OnVehicleStreamIn is called!

SetVehicleParamsForPlayer reset when a vehicle streams in for a player

https://sampwiki.blast.hk/wiki/OnVehicleStreamIn


Re: [HELP] Veh Locks Not Working!! - will_92 - 29.01.2010

hmm... that;s a new function so you're saying I should have to reapply it on OnVehicStreamIn pretty much?