SA-MP Forums Archive
[HELP]Hitman faction car problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Hitman faction car problem (/showthread.php?tid=106820)



[HELP]Hitman faction car problem - Lilcuete - 05.11.2009

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




Re: [HELP]Hitman faction car problem - Lilcuete - 05.11.2009

Anyone?


Re: [HELP]Hitman faction car problem - Alice[WS] - 05.11.2009

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..


Re: [HELP]Hitman faction car problem - Lilcuete - 05.11.2009

still dont work


Re: [HELP]Hitman faction car problem - Alice[WS] - 05.11.2009

So post the script of when the player enter the vehicle


Re: [HELP]Hitman faction car problem - Lilcuete - 05.11.2009

Код:
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.");}
		}




Re: [HELP]Hitman faction car problem - Lilcuete - 05.11.2009

ok now can someone answer


Re: [HELP]Hitman faction car problem - Blaze09 - 06.11.2009

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.


Re: [HELP]Hitman faction car problem - retart441 - 06.11.2009

are you using a edited game mode?


Re: [HELP]Hitman faction car problem - Lilcuete - 06.11.2009

yes