23.01.2017, 22:02
Hi! Is it possible to save inside the vehicle? If so, how? Thanks!
// Displays the current coordinates
COMMAND:loc(playerid, params[])
{
// Setup local variables
new Float:x, Float:y, Float:z, Float:a, interior, virtualworld, msg[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), x, y, z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
format(msg, sizeof(msg), "{00FF00}Your vehicle is at coordinates: {FFFF00}x = %0.3f, y = %0.3f, z = %0.3f, a = %0.3f", x, y, z, a);
}
else // The player is not in a vehicle
{
// Get the location of the player
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
format(msg, sizeof(msg), "{00FF00}You are at coordinates: {FFFF00}x = %0.3f, y = %0.3f, z = %0.3f, a = %0.3f", x, y, z, a);
}
// Inform the player
SendClientMessage(playerid, -1, msg);
format(msg, sizeof(msg), "{00FF00}Interior: {FFFF00}%i{00FF00}, virtual world: {FFFF00}%i", interior, virtualworld);
SendClientMessage(playerid, -1, msg);
// Let the server know that this was a valid command
return 1;
}