24.05.2016, 23:56
It is:
PHP код:
else if(Player[playerid][AdminLevel] >= 5)
{
if(id < 1 || id > MAX_VEHICLES) return SendClientMessage(playerid, WHITE, "That is not a valid vehicle ID!");
if(Vehicle[id][VehID] > 1) return SendClientMessage(playerid, WHITE, "That is not a valid dynamic vehicle ID!");
Array[0] = 0;
id = id - 1; // Here we subtract the ID the player put into the command.
if(strcmp(usage, "spawn", true) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, WHITE, "You must be in a vehicle to edit the spawn!");
new Float:Pos[4];
GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
Vehicle[id][VehiclePos][0] = Pos[0];
Vehicle[id][VehiclePos][1] = Pos[1];
Vehicle[id][VehiclePos][2] = Pos[2];
Vehicle[id][VehiclePos][3] = Pos[3];
Vehicle[id][VehicleVW] = GetPlayerVirtualWorld(playerid);
Vehicle[id][VehicleInt] = GetPlayerInterior(playerid);
format(Array, sizeof(Array), "You have moved the spawn of vehicle %d", id + 1);
SendClientMessage(playerid, WHITE, Array);
format(Array, sizeof(Array), "[/EDITVEHICLE] %s has moved the spawn of vehicle %d to X: %f, Y: %f, Z: %f", GetName(playerid), id + 1, Pos[0], Pos[1], Pos[2]);
}
else
{
SendClientMessage(playerid, WHITE, "USAGE: /editvehicle [id] [usage] [(optional) amount]");
return SendClientMessage(playerid, GREY, "Usages: spawn, colour(1-2), group, delete");
}
Log(4, Array);
RespawnVehicle(id); // Here we respawn that ID.
SaveVehicle(id);