SA-MP Forums Archive
Specific ranked 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)
+--- Thread: Specific ranked car? (/showthread.php?tid=507005)



Specific ranked car? - HK - 15.04.2014

Ok, lets say like that, there's a drug cartel who got 4 vehicles, the last vehicle is ONLY for the leader who got rank 4 in their group.

[pawno]AddStaticVehicle(579,2490.1045,-1190.0026,43.1381,269.0307,10,10); // DrugC4[/pawno]


here's my variable:

if(PInfo[playerid][pTS] >= 4) { // etc.

Can anyone show me how exactly to make the static vehicle only be used by pTS rank 4?


Re: Specific ranked car? - crouch010 - 15.04.2014

here it is.

Quote:

new drug4 = AddStaticVehicle(579,2490.1045,-1190.0026,43.1381,269.0307,10,10); // DrugC4

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:cx, Float:cy, Float:cz;
GetPlayerPos(playerid, cx, cy, cz);
if(!ispassenger)
{
if(vehicleid == drug4)
{
if(PInfo[playerid][pTS] >= 4)
{
}
else
{
SendClientMessage(playerid, COLOR_GRAD1," blabla text.");
SetPlayerPos(playerid, cx, cy, cz);
}
}
}
return 1;
}