HELP WITH PLAyertopoint while in a car
#1

i hav this so far i neeed it to work while a player is in a car

Code:
if (PlayerToPoint(5.0, playerid, MatsDeliver[i][Matsx], MatsDeliver[i][Matsy], MatsDeliver[i][Matsz]))
 		{
		  if(MatsHolding[playerid] > 0)
		  {
		  	new payout = (50)*(MatsHolding[playerid]);
		    format(string, sizeof(string), "* The Factory Gave You %d Materials from your %d Packages.", payout, MatsHolding[playerid]);
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
		    PlayerInfo[playerid][pMats] += payout;
		    MatsHolding[playerid] = 0;
		  }
	  	}
Reply
#2

pawn Code:
stock IsPlayerVehicleInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
{   // Created by Y_Less

    new
        Float:px,
        Float:py,
        Float:pz;
    GetVehiclePos(GetPlayerVehicleID(playerid), px, py, pz);
    px -= x;
    py -= y;
    pz -= z;
    return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}
Very simple. And you need to swap your first two parameters around to make it fit this.
Reply
#3

Thank you for helping out i will try this as well i did get it to work by making a new command checkfordrivingpoint using playertopointstripped it checks to see if your in a car and that worked for the most part....undertimer i made this command
Code:
			if (GetPlayerState(i) == 2) CheckForDrivingTeleport(i);
Reply
#4

It shouldn't really matter, player position will be (near) the same as the player's vehicle position. Only the VehicleZAngle and PlayerFacingAngle are different, (PlayerFacingAngle doesn't update when player is in a vehicle)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)