SA-MP Forums Archive
create vehicle. - 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: create vehicle. (/showthread.php?tid=467857)



create vehicle. - audriuxxx - 05.10.2013

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);



Re: create vehicle. - knackworst - 05.10.2013

Simply yes


Re: create vehicle. - Patrick - 05.10.2013

[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


AW: create vehicle. - audriuxxx - 05.10.2013

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


Re: create vehicle. - Patrick - 05.10.2013

You Mean this?

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



AW: create vehicle. - audriuxxx - 05.10.2013

Yes.


Re: create vehicle. - Jankingston - 05.10.2013

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