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



Saving inside vehicle - eikzdej - 23.01.2017

Hi! Is it possible to save inside the vehicle? If so, how? Thanks!


Re: Saving inside vehicle - GangstaSunny. - 23.01.2017

just use the /save command.
you will find the saved coordinates in your gta sa user files/samp/savedpositions.txt


Re: Saving inside vehicle - AmigaBlizzard - 23.01.2017

You can use a command like this to see your coordinates in-game:
PHP код:
// Displays the current coordinates
COMMAND:loc(playeridparams[])
{
    
// Setup local variables
    
new Float:xFloat:yFloat:zFloat:ainteriorvirtualworldmsg[128];

    
// Get the interior and virtual world of the player
    
interior GetPlayerInterior(playerid);
    
virtualworld GetPlayerVirtualWorld(playerid);

    
// If the player is inside a vehicle
    
if (IsPlayerInAnyVehicle(playerid) == 1)
    {
        
// Get the location of the vehicle
        
GetVehiclePos(GetPlayerVehicleID(playerid), xyz);
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
        
format(msgsizeof(msg), "{00FF00}Your vehicle is at coordinates: {FFFF00}x = %0.3f, y = %0.3f, z = %0.3f, a = %0.3f"xyza);
    }
    else 
// The player is not in a vehicle
    
{
        
// Get the location of the player
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playerida);
        
format(msgsizeof(msg), "{00FF00}You are at coordinates: {FFFF00}x = %0.3f, y = %0.3f, z = %0.3f, a = %0.3f"xyza);
    }

    
// Inform the player
    
SendClientMessage(playerid, -1msg);
    
format(msgsizeof(msg), "{00FF00}Interior: {FFFF00}%i{00FF00}, virtual world: {FFFF00}%i"interiorvirtualworld);
    
SendClientMessage(playerid, -1msg);

    
// Let the server know that this was a valid command
    
return 1;




Re: Saving inside vehicle - eikzdej - 24.01.2017

Hi guys, thank you for your replies, but What i mean, if I logout and i'm inside the vehicle, and when I log in back, I'm also inside the vehicle.


Re: Saving inside vehicle - eikzdej - 24.01.2017

Bump?


Re: Saving inside vehicle - kloning1 - 25.01.2017

according to my logic

First you have to have a variable that stores the current player in a vehicle
then when the player is logged in, he is the variable load, and input into car

for the function with itself you can use
PutPlayerInVehicle
Код:
https://sampforum.blast.hk/showthread.php?tid=102647
explain PutPlayerInVehicle
wiki.sa-mp.com down in my country


Re: Saving inside vehicle - Rdx - 25.01.2017

Quote:
Originally Posted by kloning1
Посмотреть сообщение
wiki.sa-mp.com down in my country
Just change https to http and it will be working.