23.10.2012, 17:35
pawn Код:
else if(strcmp(x_nr,"park",true) == 0)
{
if(PlayerInfo[playerid][pCar] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
if(carid == PlayerInfo[playerid][pCar])
{
new Float:x,Float:y,Float:z;
new Float:a;
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "You have saved your vehicle at the position %f.01, %f.01, %f.01, Remember it, it will respawn here!",x,y,z);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveCar(carid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
return 1;
}
return 1;
}
But this command saves the car at the wanted location after a server restart.
How to make it save without a server restart?