OMG HELP - 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: OMG HELP (
/showthread.php?tid=293106)
OMG HELP -
Buzzbomb - 26.10.2011
Is this Right cause I am Fireteam 2 But I still get Ejected From the vehicle
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new Vehicle = GetPlayerVehicleID(playerid);
if( Vehicle == FiremanVehicle1 && PlayerInfo[playerid][pFireTeam] >= 2)
{
SendClientMessage(playerid, 0x33AA33AA, "You Are Not On Fire Duty");
RemovePlayerFromVehicle(playerid >= FiremanVehicle1);
}
else
{
if(newstate == PLAYER_STATE_PASSENGER)
{
format(string, sizeof(string), "You Entered A %s, Owned By AFD", VehicleNames[GetVehicleModel(Vehicle) -400]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
}
}
Re: OMG HELP -
grand.Theft.Otto - 27.10.2011
Quote:
Originally Posted by Buzzbomb
Is this Right cause I am Fireteam 2 But I still get Ejected From the vehicle
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) { new Vehicle = GetPlayerVehicleID(playerid); if( Vehicle == FiremanVehicle1 && PlayerInfo[playerid][pFireTeam] >= 2) { SendClientMessage(playerid, 0x33AA33AA, "You Are Not On Fire Duty"); RemovePlayerFromVehicle(playerid >= FiremanVehicle1); } else { if(newstate == PLAYER_STATE_PASSENGER) { format(string, sizeof(string), "You Entered A %s, Owned By AFD", VehicleNames[GetVehicleModel(Vehicle) -400]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); return 1; } } }
|
pawn Код:
PlayerInfo[playerid][pFireTeam] >= 2
That line, you're checking if their information is greater than or equal to 2. Instead of the " = ", make it " > " only:
pawn Код:
PlayerInfo[playerid][pFireTeam] > 2 // only if their info is greater than 2, you can do >= 3 also
Whats this:
pawn Код:
RemovePlayerFromVehicle(playerid >= FiremanVehicle1);
Should be:
pawn Код:
RemovePlayerFromVehicle(playerid);
Re: OMG HELP -
MP2 - 27.10.2011
If you only want faction 2 to be able to drive the vehicle, use the 'is not' operator:
PlayerInfo[playerid][pFireTeam] != 2