SA-MP Forums Archive
Why this doesnt work??? - 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: Why this doesnt work??? (/showthread.php?tid=126087)



Why this doesnt work??? - hvampire - 07.02.2010

i want when certain team get in a vehicle it changes the color :::

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{

if(gTeam[playerid] == TEAM_LS)
{
ChangeVehicleColor(476, 16, 1);
}
else if(gTeam[playerid] == TEAM_LV)
{
ChangeVehicleColor(476, 65, 1);
}

return 1;
}


Re: Why this doesnt work??? - BlackFoX - 07.02.2010

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(gTeam[playerid] == TEAM_LS)
{
ChangeVehicleColor(vehicleid, 16, 1);
}
else if(gTeam[playerid] == TEAM_LV)
{
ChangeVehicleColor(vehicleid, 65, 1);
}
return 1;
}
you does use the Model ID but you must use vehicleid ^^


Re: Why this doesnt work??? - hvampire - 07.02.2010

how to compare between model id and vehicle id?


Re: Why this doesnt work??? - BlackFoX - 07.02.2010

when you creating Vehicles

CreateVehicle(...);

in OnGameModeInit or somewhere and it is your first Vehicle it has ID 0, the next Vehicle has ID 1 and so on


Re: Why this doesnt work??? - hvampire - 07.02.2010

guys i have 1 more question : i made a system that players can only use certain vehicles (hydras , rustlers) so i putted them in my gamemode and defined if the player is under level 1 , and it blocked all players not under level 1 only , and when i putted it in admin script , didnt do anything :S