Faction Vehicles.... Need help, ASAP.
#1

Код:
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.
Reply
#2

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)