Is player standing at vehicle's trunk or hood
#12

damn, it won't work :/
It says that I'm not near vehicle. This is part of /trunk:
Code:
if(PlayerInfo[playerid][pVeh] || PlayerInfo[playerid][pVeh2] || PlayerInfo[playerid][pVeh3] || PlayerInfo[playerid][pVeh4] || PlayerInfo[playerid][pVeh5])
    {
        new Float:vx, Float:vy, Float:vz;
        // veh 1
	    GetTrunkPos(PlayerInfo[playerid][pVeh],vx,vy,vz);
	    if(IsPlayerInRangeOfPoint(playerid,1.0, vx,vy,vz))
	    {
	        idx = PlayerInfo[playerid][pVeh];
	        if(IsBike(idx)) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have trunk.");
			GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
			if(!boot)
			{

			    SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 1, objective);
			    format(string, sizeof(string), "* %s opens their vehicle's trunk.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
			}
			else
			{
			    SetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, 0, objective);
			    format(string, sizeof(string), "* %s closes their vehicle's trunk.", RPN(playerid));
				SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
			}
			done = 1;
			return 1;
	    }
stocks are the same as you wrote them
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)