Team Cars Problem! - 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 Problem! (
/showthread.php?tid=388563)
Team Cars Problem! -
Majava - 29.10.2012
Team Cars Problem! Everything is compiling and i think it works but it doesnt WORK!
I think problem is somewhere in PlayerStateChange help me :<
Pastebin
pawn Код:
#define CORLEONE 3
enum TeamCars
{
Corleone
}
new Cars[TeamCars];
Cars[Corleone] = CreateVehicle(545,488.6407,-1498.9587,20.2783,351.7271,0,0,120); // Corleone Car 1
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new CarCheck = GetPlayerVehicleID(playerid);
if(CarCheck == Cars[Corleone])
{
if(gTeam[playerid] == CORLEONE)
{
SendClientMessage(playerid,COLOR_GREEN, "You are now driving the Grove Car!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You do not have the keys for this car!");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
Re: Team Cars Problem! -
Stereotype - 29.10.2012
why you can't see example in some gamemode script?
Re: Team Cars Problem! -
park4bmx - 29.10.2012
the check needs to be like this
pawn Код:
if(CarCheck == Cars[CORLEONE])//your team is "CORLEONE" as defined
{
if(gTeam[playerid] != 1) return SendClientMessage(playerid,-1,"Not team car!");
//if its a players team car just continue with the script
SendClientMessage(playerid,-1,"Your driving CORLEONE team's car");
}