Add static vehicel
#1

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

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");
}
}
}
Reply
#3

well im useing a rp gm lol so
Reply
#4

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.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)