Vehicle doesn't spawn
#1

Hello, I have been trying to make a copy of my /veh command but then with the mselection this is the /veh cmd:


PHP код:
CMD:veh(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 4) {
        new
            
iVehicle,
            
iColors[2];
        if(
sscanf(params"iii"iVehicleiColors[0], iColors[1])) {
            
SendClientMessageEx(playeridCOLOR_GREY"USAGE: /veh [model ID] [color 1] [color 2]");
        }
        else if(!(
400 <= iVehicle <= 611)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid model specified (model IDs start at 400, and end at 611).");
        }
        else if(
IsATrain(iVehicle)) {
            
SendClientMessageEx(playeridCOLOR_GREY"Trains cannot be spawned during runtime.");
        }
        else if(!(
<= iColors[0] <= 255 && <= iColors[1] <= 255)) {
            
SendClientMessageEx(playeridCOLOR_GRAD2"Invalid color specified (IDs start at 0, and end at 255).");
        }
        else for(new 
iIteratoriIterator sizeof(CreatedCars); iIterator++) if(iIterator >= 49) {
            return 
SendClientMessageEx(playeridCOLOR_GRAD1"The maximum limit of 50 spawned vehicles has been reached.");
        }
        else if(
CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
            new
                
FloatfVehPos[4];
            new 
fVW GetPlayerVirtualWorld(playerid);
            
GetPlayerPos(playeridfVehPos[0], fVehPos[1], fVehPos[2]);
            
GetPlayerFacingAngle(playeridfVehPos[3]);
            
CreatedCars[iIterator] = CreateVehicle(iVehiclefVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
            
VehicleFuel[CreatedCars[iIterator]] = 100.0;
            
Vehicle_ResetData(CreatedCars[iIterator]);
            
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
            
SetVehicleVirtualWorld(CreatedCars[iIterator], fVW);
            return 
SendClientMessageEx(playeridCOLOR_GREY"Vehicle spawned!");
        }
    }
    else 
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command.");
    return 
1;
}] 
This is the list to spawn it with the MSelection as you can see I masked things with numbers to see how far it comes in the console, it doesn't go further then number 2


PHP код:
if(listid == AdminCarList)
    {
        new
            
iVehicle,
            
iColors[2];
        if(
IsATrain(iVehicle)) {
            
SendClientMessageEx(playeridCOLOR_GREY"Trains cannot be spawned during runtime.");
        }
        else for(new 
iIteratoriIterator sizeof(CreatedCars); iIterator++) if(iIterator >= 49) {
            return 
SendClientMessageEx(playeridCOLOR_GRAD1"The maximum limit of 50 spawned vehicles has been reached.");
        }
        else if(
CreatedCars[iIterator] == INVALID_VEHICLE_ID) {
            new
                
FloatfVehPos[4];
            
//new iVehicle[MAX_PLAYERS];
            
print("1");
            new 
fVW GetPlayerVirtualWorld(playerid);
            
GetPlayerPos(playeridfVehPos[0], fVehPos[1], fVehPos[2]);
            
GetPlayerFacingAngle(playeridfVehPos[3]);
            
CreatedCars[iIterator] = CreateVehicle(iVehiclefVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
            print(
"2");
            
VehicleFuel[CreatedCars[iIterator]] = 100.0;
            
Vehicle_ResetData(CreatedCars[iIterator]);
            print(
"3");
            
LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
            print(
"4");
            
SetVehicleVirtualWorld(CreatedCars[iIterator], fVW);
            return 
SendClientMessage(playerid0xFF0000FF"Admin vehicle spawned");
        }
        else 
SendClientMessage(playerid0xFF0000FF"Canceled Admin vehicle selection");
        return 
1;
    } 
Reply


Messages In This Thread
Vehicle doesn't spawn - by IndependentGaming - 21.02.2018, 19:55
Re: Vehicle doesn't spawn - by Kaperstone - 21.02.2018, 20:13
Re: Vehicle doesn't spawn - by IndependentGaming - 21.02.2018, 20:16
Re: Vehicle doesn't spawn - by IndependentGaming - 22.02.2018, 00:21
Re: Vehicle doesn't spawn - by AstroPoid - 22.02.2018, 00:26
Re: Vehicle doesn't spawn - by AstroPoid - 22.02.2018, 00:31
Re: Vehicle doesn't spawn - by NaS - 22.02.2018, 00:42
Re: Vehicle doesn't spawn - by Mugala - 22.02.2018, 11:52
Re: Vehicle doesn't spawn - by IndependentGaming - 22.02.2018, 13:29
Re: Vehicle doesn't spawn - by IndependentGaming - 22.02.2018, 14:05

Forum Jump:


Users browsing this thread: 4 Guest(s)