[Help] Possition 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)
+--- Thread: [Help] Possition problem (
/showthread.php?tid=361886)
[Help] Possition problem -
devil shill - 22.07.2012
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.
Re: [Help] Possition problem -
devil shill - 22.07.2012
I really need it
Re: [Help] Possition problem -
XStormiest - 22.07.2012
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);
}
Re: [Help] Possition problem -
devil shill - 22.07.2012
Didnt work actualy it crashed my server....
Re: [Help] Possition problem -
[KHK]Khalid - 22.07.2012
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
Re: [Help] Possition problem -
devil shill - 22.07.2012
Great Thanks man for your help ^^ < 3