Lock cars for team. - 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: Lock cars for team. (
/showthread.php?tid=362995)
Lock cars for team. -
olari9 - 26.07.2012
http://pastebin.com/nmvTcxX8
Hi guys, I have a little problem. The code seems like 100% right but still I can take my own team cars and this is annoying me cos other players are taking our base cars to enemy and they would gain point like that. So guys, how can it be fixed? Thank you!
Re: Lock cars for team. -
Dan. - 26.07.2012
Tere Olari. Why won't you just kick the player out of the car when he enter it? Something like this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(gCars[vehicleid][CarTeam] == gPlayer[playerid][Team])
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Re: Lock cars for team. -
olari9 - 26.07.2012
Ok thank you!
Re: Lock cars for team. -
JaKe Elite - 26.07.2012
Try looking Rivershell gamemode.
It has some example, one of them is Locking vehicle for other team.