Small/Easy Issue
#1

Right, I'm trying to fix a little mix up in the script I have and I wanted to change this part of the script

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, 0)
{
	GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
	if(engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET)
	{
        SendClientMessage(playerid, COLOR_WHITE,"< To turn on the vehicle engine type {800040}/engine{FFFFFF} - to check radio commands type {800040}/radiohelp{FFFFFF} >");
	}
	else if(IsAFBICar(vehicleid))
	{
	    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { }
	    else { SendClientMessage(playerid,COLOR_GREY,"   You are not in the FBI"); ClearAnimations(playerid); }
	}
	else if(IsACopCar(vehicleid))
	{
		if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { }
	    else { SendClientMessage(playerid,COLOR_GREY,"   You are not in the LSPD/SASD !"); ClearAnimations(playerid); }
	}
	else if(IsANGCar(vehicleid))
	{
		if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { }
	    else { SendClientMessage(playerid,COLOR_GREY,"   You are not in the DoC !"); ClearAnimations(playerid); }
	}
    else if(IsAnAmbulance(vehicleid))
	{
		if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { }
	    else { SendClientMessage(playerid,COLOR_GREY,"   You are not in the LSFMD !"); ClearAnimations(playerid); }
	}
    else if(IsANewsCar(vehicleid))
	{
		if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) { }
	    else { SendClientMessage(playerid,COLOR_GREY,"   You are not in the news agency !"); ClearAnimations(playerid); }
	}
	if(vehicleid >= vipCars[0] && vehicleid <= vipCars[39])
	{
	    if(PlayerInfo[playerid][pDonateRank] < 1)
	    {
	    	SendClientMessage(playerid, -1,"    You're not a VIP!");
	    	ClearAnimations(playerid);
		}
    }
	if(vehicleid >= rlounge[0] && vehicleid <= rlounge[3])
	{
	    if(PlayerInfo[playerid][pDonateRank] < 1)
	    {
	    SendClientMessage(playerid, -1," You're not a VIP!");
	    ClearAnimations(playerid);
	    }
	}
	if(vehicleid >= Trashmaster[0] && vehicleid <= Trashmaster[2])
	{
	    if(PlayerInfo[playerid][pJob] != 11)
	    {
  		    SendClientMessage(playerid, COLOR_GREY,"You are not a Trashman");
	    	ClearAnimations(playerid);
	    }
	}
		if(vehicleid >= MailBike[0] && vehicleid <= MailBike[5])
	{
	    if(PlayerInfo[playerid][pJob] != 22)
	    {
  		    SendClientMessage(playerid, COLOR_GREY,"You are not a Mail-Man");
	    	ClearAnimations(playerid);
	    }
	}
	if(vehicleid >= PizzaBike[0] && vehicleid <= PizzaBike[4])
	{
	    if(PlayerInfo[playerid][pJob] != 20)
	    {
	        SendClientMessage(playerid, COLOR_GREY,"You are not a Pizza-Boy");
	        ClearAnimations(playerid);
	    }
	}
		if(vehicleid >= CopVehicle[0] && vehicleid <= CopVehicle[6])
	{
		if(PlayerInfo[playerid][pMember] != 1)
	    {
	    	SendClientMessage(playerid, COLOR_WHITE,"You don't have the keys of this vehicle( Faction-vehicle)");
	    	ClearAnimations(playerid);
		}
	}
	return 1;
}
As you can see this code won't let you enter a car if your not in the specific faction, Is there a way to fix it so You cannot enter as a DRIVER unless you are in that faction. This code won't allow passengers no matter how I edit it and how much i read this part of SA-MP WIKI.
https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle
Reply


Messages In This Thread
Small/Easy Issue - by Harmon - 07.09.2012, 17:11
Re: Small/Easy Issue - by Glint - 07.09.2012, 17:17
Re: Small/Easy Issue - by Harmon - 07.09.2012, 17:23
Re: Small/Easy Issue - by Harmon - 07.09.2012, 17:42
Re: Small/Easy Issue - by Glint - 07.09.2012, 19:29
Re: Small/Easy Issue - by Harmon - 07.09.2012, 21:13
Re: Small/Easy Issue - by clarencecuzz - 07.09.2012, 21:45
Re: Small/Easy Issue - by Harmon - 08.09.2012, 00:40

Forum Jump:


Users browsing this thread: