create vehicle.
#1

Hi,

When i create vehicle, can i get right now coordinates? like:

new Float:X,Float:Y,Float:Z;
Код:
new car = CreateVehicle(blabla...);
GetVehiclePos(car,X,Y,Z);
Reply
#2

Simply yes
Reply
#3

[i]You used GetPlayerPos to spawn a vehicle at your current location.[/b]

Example
pawn Код:
new Float:PosX, Float:PosY, Float:PosZ, Float:pAngle;
GetPlayerPos(playerid, PosX,PosY,PosZ);
GetPlayerFacingAngle(playerid, pAngle);
AddStaticVehicle(VehicleID, PosX, PosY, PosZ, pAngle, Color Number 1, Color Number 2);
But if you just want to check the vehicle's Position X, Position Y, Position Z you could just simply use the sa-mp default command /dl
Reply
#4

Ok thanks guys!! and now if player exit from game, can i check OnPlayerDisconnect isplayerinanyvehicle ?
Reply
#5

You Mean this?

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        //Your stuff here
    }
    return 1;
}
Reply
#6

Yes.
Reply
#7

or simply use this : -filterscript_other-7901/]Clicky
Reply


Forum Jump:


Users browsing this thread: