SA-MP Forums Archive
Team cars? - 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: Team cars? (/showthread.php?tid=430039)



Team cars? - icko202 - 12.04.2013

Can someone tell me how to make team cars? i made one but its working only 1 car ...


Re: Team cars? - [XST]O_x - 12.04.2013

https://sampforum.blast.hk/showthread.php?tid=160810


Re: Team cars? - icko202 - 12.04.2013

Its working only one car


Re: Team cars? - zT KiNgKoNg - 12.04.2013

new BlueTeamCars[3];

OnGameModeInt

BlueTeamCars[0] = CAR 1
BlueTeamCars[1] = CAR 2
BlueTeamCars[2] = CAR 3

If you want to kick them out of the other vehicles just comment


Re: Team cars? - icko202 - 12.04.2013

but how to make the check?


Re: Team cars? - zT KiNgKoNg - 12.04.2013

It would help if you told us what you mean by "CHECK"


Re: Team cars? - icko202 - 12.04.2013

This:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Police] )
{
if(gTeam[playerid] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
if(CarCheck == Cars[Mafia] )
{
if(gTeam[playerid] != 2)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
return 1;
}
}
return 1;
}
return 1;
}

How to fix it to checks if player is police to been kicked removed from ANY mafia cars