[Help] Possition problem
#1

hey i got a problem in my car dealership system if i buy a car it spawn here

Код:
								CarInfo[car][cLocationx] = 1432.6451;
								CarInfo[car][cLocationy] = 1378.7216;
								CarInfo[car][cLocationz] = 11.5507;
								CarInfo[car][cAngle] = 359.2072;
But i dont know if there is a code that it will spawn to the player
if so pleas can someone tell it ?

Thanks alot.
Reply
#2

I really need it
Reply
#3

you want to transport car to player? try this function

pawn Код:
stock TeleportVehicleToPlayer(playerid,vehicleid,angle)
{
         new interior, Float:zX,Float:zY,Float:zZ,Float:angle;
             GetPlayerFacingAngle(playerid,angle);
           GetPlayerPos(playerid,zX,zY,zZ);
         CreateVehicle(vehicleid,x,y,z,angle,random(20),random(30),40);
        interior = GetPlayerInterior(playerid);
       LinkVehicleToInterior(vehicleid,interior);
        return PutPlayerInVehicle(playerid,vehicleid,0);
}
Reply
#4

Didnt work actualy it crashed my server....
Reply
#5

You can use GetPlayerPos for that, example:

pawn Код:
new Float:x, Float:y, Float:z; // float variables x, y and z to use them in GetPlayerPos
GetPlayerPos(playerid, x, y, z); // gets the player's position and stores it into the variables we made
// now you have the player's position co-ordinates (x, y and z) so let's use them
CarInfo[car][cLocationx] = x; // you can put x + 4 here if you want
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = 359.2072; // no need to change this
Reply
#6

Great Thanks man for your help ^^ < 3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)