SA-MP Forums Archive
Add static vehicel - 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: Add static vehicel (/showthread.php?tid=124582)



Add static vehicel - robert4049 - 31.01.2010

ok in a rp game mod with car ids. how would u add a vehicel for a faction like grove liks useing addstaticvehicelex


Re: Add static vehicel - mansonh - 31.01.2010

All depends on your team system. If you have a team system already then post it otherwist heres a simple example.

PlayerTeam[MAX_PLAYERS];
VehicleTeam[MAX_VEHICLES];
#define Team0 0
#define Team1 1

public OnGameModeInit()
{
new vehicle = AddStaticVehicle(...);
VehicleTeam[vehicle] = Team0;
....
}
//I assume by a team vehicle you only want people on that team to be able to use it.
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(PlayerTeam[playerid] != VehicleTeam[GetPlayerVehicleID(playerid)])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAA0000AA, "Vehicle does not match team");
}
}
}


Re: Add static vehicel - robert4049 - 31.01.2010

well im useing a rp gm lol so


Re: Add static vehicel - mansonh - 31.01.2010

Well as i said it all depends on your gamemode. If its one you downloaded then ask whoever made it.

I was just showing you an example.


Re: Add static vehicel - robert4049 - 31.01.2010

i have no replies for a month so... and im new to scripting but i'am learning