[HELP]Hitman faction car problem
#1

Ok when i enter the hitman faction vehicle it says i dont have the keys of the bus but im in the faction still does that heres my code
Код:
public IsABus(carid)
{
	if(carid == 59 || carid == 60)
	{
		return 1;
	}
	return 0;
}
dis is the bus code and now dis is the hitman code
Код:
public IsAHitman(carid)
{
if(carid >= 188 && carid <= 189 || carid <= 190)
	{
		return 1;
	}
	return 0;
}
Ok and the carid 190 is supposed to be the bullet but i do not know whats the carid for bullet not the vehicle id thecar id

Reply
#2

Anyone?
Reply
#3

Quote:
Originally Posted by Lilcuete
Код:
public IsAHitman(carid)
{
if(carid >= 188 && carid <= 189 || carid <= 190)
	{
		return 1;
	}
	return 0;
}
i don't think it will work, in my opinion it shoud be like that :
Код:
public IsAHitman(carid)
{
if(carid >= 188 && carid <= 190)
	{
		return 1;
	}
	return 0;
}

Quote:
Originally Posted by Lilcuete
not the vehicle id thecar id
it is the same


the bug can also come from when the player enter the vehicle..
Reply
#4

still dont work
Reply
#5

So post the script of when the player enter the vehicle
Reply
#6

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	if(gTeam[playerid] >= 1||gTeam[playerid] >= 3||gTeam[playerid] >= 4)
	{
		if (IsACopCar(vehicleid) && !ispassenger)
		{
			if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
		  else {
				//WantedPoints[playerid]+=2;
				//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
				new Float:cx, Float:cy, Float:cz;
				GetPlayerPos(playerid, cx, cy, cz);
				SetPlayerPos(playerid, cx, cy, cz);
			}
		}
		if (IsNgCar(vehicleid) && !ispassenger)
		{
		  if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==2||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pMember]==3) {}
		  else {
				//WantedPoints[playerid]+=2;
				//SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
				new Float:cx, Float:cy, Float:cz;
				GetPlayerPos(playerid, cx, cy, cz);
				SetPlayerPos(playerid, cx, cy, cz);
			}
		}
		if (IsAnAmbulance(vehicleid) && !ispassenger)
		{
		  if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
		  else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Stealing An Ambulance"); }
		}
 		if (IsAnFiretruck(vehicleid) && !ispassenger)
		{
		  if(PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4) { }
		  else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Stealing An Fire Truck"); }
		}
		if (IsATank(vehicleid) && !ispassenger)
		{
			if(PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==3) {}
		  else { WantedPoints[playerid]+=2; SetPlayerCriminal(playerid,255, "Stealing A Tank"); SendClientMessage(playerid, COLOR_GREY,"You don't know how to drive it yet."); }
		}
		if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
		{
		  if(PlayerInfo[playerid][pAdmin] >= 1337 && AdminDuty[playerid] == 1) { }
		  else
		  {
		  	new Float:cx, Float:cy, Float:cz;
		  	GetPlayerPos(playerid, cx, cy, cz);
		  	SetPlayerPos(playerid, cx, cy, cz);
			}
		}
	}
	return 1;
}
Код:
	if(IsAHitman(newcar))
		{
		  if(PlayerInfo[playerid][pLeader] == 8||PlayerInfo[playerid][pMember] == 8) { }
		   else {
	    RemovePlayerFromVehicle(playerid);
	    SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
		}

Reply
#7

ok now can someone answer
Reply
#8

If you want to find out what the server car id for it is,

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == 2) // driver
	{
		new id; new str[256];
		id = GetPlayerVehicleID(playerid);
		format(str, sizeof(str), "ID: %d", GetPlayerVehicleID(playerid));
		SCM(playerid, COLOR_RED, str);
Add the IDs to your script, under
Код:
if(newstate == 2)
Then use "RemovePlayerFromVehicle(playerid)

Should look like:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == 2) // driver
	{
		new id; new str[256];
		id = GetPlayerVehicleID(playerid);
		format(str, sizeof(str), "ID: %d", GetPlayerVehicleID(playerid));
		SCM(playerid, COLOR_RED, str);
		if(id == //Vehicle ID Here)
    	{
		if(!IsAHitman(playerid))
			{
 			RemovePlayerFromVehicle(playerid);
    		SendClientMessage(playerid, COLOR_RED, "You Do Not Have The Keys For This Vehicle!");
    	}
    	}
        }
        return 1;
}
Sorry for poor indentations.
Reply
#9

are you using a edited game mode?
Reply
#10

yes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)