Vehicle ID Issue (REP+)
#5

Quote:
Originally Posted by Jefff
Посмотреть сообщение
Here must be too (id-1)
It is:

PHP код:
else if(Player[playerid][AdminLevel] >= 5)
    {
        if(
id || id MAX_VEHICLES) return SendClientMessage(playeridWHITE"That is not a valid vehicle ID!");
        if(
Vehicle[id][VehID] > 1) return SendClientMessage(playeridWHITE"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(playeridWHITE"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(playeridWHITE, Array);
            
format(Array, sizeof(Array), "[/EDITVEHICLE] %s has moved the spawn of vehicle %d to X: %f, Y: %f, Z: %f"GetName(playerid), id 1Pos[0], Pos[1], Pos[2]);
        }
        else
        {
            
SendClientMessage(playeridWHITE"USAGE: /editvehicle [id] [usage] [(optional) amount]");
            return 
SendClientMessage(playeridGREY"Usages: spawn, colour(1-2), group, delete");
        }
        
Log(4, Array);
        
RespawnVehicle(id); // Here we respawn that ID.
        
SaveVehicle(id); 
Reply


Messages In This Thread
Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:04
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:36
Re: Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:44
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:53
Re: Vehicle ID Issue (REP+) - by BornHuman - 24.05.2016, 23:56
Re: Vehicle ID Issue (REP+) - by Jefff - 24.05.2016, 23:59
Re: Vehicle ID Issue (REP+) - by BornHuman - 25.05.2016, 00:10
Re: Vehicle ID Issue (REP+) - by Jefff - 25.05.2016, 00:16
Re: Vehicle ID Issue (REP+) - by BornHuman - 25.05.2016, 00:20
Re: Vehicle ID Issue (REP+) - by Jefff - 25.05.2016, 00:24

Forum Jump:


Users browsing this thread: 1 Guest(s)