This Should work :- (it's untested)
Код:
COMMAND:park(playerid, params[])
{
if (playerData[playerid][playerLoggedIn])
{
if (IsPlayerInAnyVehicle(playerid))
{
new
vid = GetPlayerVehicleID(playerid),
query[400]
;
for(new i; i < MAX_SAVED_VEHICLES; i++)
{
if (vid != VehicleInfo[i][vehicleID]) continue;
if(VehicleInfo[i][vOwner] != playerData[playerid][actualID] && playerData[playerid][playerLevel] < 3)
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot park another player's vehicle.");
}
else
{
new
vehicle,
Float:x,
Float:y,
Float:z,
Float:za,
Float:a
;
vehicle = GetPlayerVehicleID(playerid);
GetVehiclePos(vehicle, x, y, z);
new world = GetVehicleVirtualWorld(vehicle);
GetVehicleZAngle(vehicle, za);
GetPlayerFacingAngle(playerid, a);
VehicleInfo[i][vX] = x;
VehicleInfo[i][vY] = y;
VehicleInfo[i][vZ] = z;
VehicleInfo[i][vWorld] = world;
VehicleInfo[i][vAngle] = za;
format(query, sizeof(query), "UPDATE `vehicles` SET `x` = '%f', `y` = '%f', `z` = '%f', `world` = '%i', `angle` = '%f' WHERE `id` = '%i'", x, y, z,world, za, i);
SendClientMessage(playerid, COLOR_WHITE, "{58D3F7}[VEHICLE] {FFFFFF}Your vehicle will spawn here in future.");
new debugmsg[200];
format(debugmsg, sizeof(debugmsg), "Tried to park DB ID: %d", i);
print(debugmsg);
db_query(DB: VEHICLESDB, query);
}
break;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be inside a vehicle to use this command.");
}
}
if it doesn't work, pm me you variables and enumators you are using. so that i can understand a bit more and resolve your problem.