Faction Vehicles.... Need help, ASAP. - 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: Faction Vehicles.... Need help, ASAP. (
/showthread.php?tid=315102)
Faction Vehicles.... Need help, ASAP. -
wolfcock - 01.02.2012
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new carid;
new i = 0;
if(carid == CopCar[i])
{
if(PlayerInfo[playerid][pMember] > 1)
SCM(playerid, RED,"Type /engine to turn the engine on/off");
return 1;
}
else
{
SCM(playerid,RED,"You're NOT an Flint County Sheriffs Department Officer!");
}
if(carid == FCFD[i])
{
if(PlayerInfo[playerid][pMember] > 3)
SCM(playerid, RED,"Type /engine to turn the engine on/off");
return 1;
}
else
{
return SCM(playerid,RED,"You're NOT an Flint County Fire Department member!");
}
//return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new carid;
new i = 0;
if(carid == CopCar[i])
{
if(PlayerInfo[playerid][pMember] > 1)
return 1;
}
else return RemoveFromVeh(playerid), SCM(playerid,RED,"You're NOT an Flint County Sheriffs Department Officer!");
if(carid == FCFD[i])
{
if(PlayerInfo[playerid][pMember] > 3)
return 1;
}
else return RemoveFromVeh(playerid), SCM(playerid,RED,"You're NOT an Flint County Fire Department member!");
return 1;
}
Alright, if i'm faction member 0... I get no message like: "You're NOT an Flint County Fire Department member!".
But if i'm faction member 3 (FCFD) and enter it says what it should when i'm not in the faction.
The "else" thing like, if it doesn't find if member is 0 doesn't work, i need help :/
OH YEAH - And it compiles like it should.
Re: Faction Vehicles.... Need help, ASAP. -
Steven82 - 02.02.2012
pawn Код:
if(PlayerInfo[playerid][pMember] > 1)
Will allow anyone above faction 1 to enter the vehicle, but none lower than 1.
So use this code instead.
pawn Код:
if(PlayerInfo[playerid][pMember] == 1)