/Spawncar is not functional
#1

Basically I have been working on a /spawncar command that will spawn a car for administrators upon a command. Each time I type /spawncar it will give the error message stating I have not filled in the other required fields, although I have.

Here is the script:
pawn Код:
command(spawncar, playerid, vehicleid, params[])
{
    new carid, string[128], Float: CarToX, Float: CarToY, Float: CarToZ, physical_car_id, c1, c2;
    if(sscanf(params, "ddd", carid, c1, c2))
    {
        if(Player[playerid][AdminLevel] >= 1)
        {
            SendClientMessage(playerid, ERROR, "SYNTAX: /spawncar [vehicleid] [colour 1] [colour 2]");
        }
        else
        {
            SendClientMessage(playerid, ERROR, "ERROR: You are not authorized to use this command!");
        }
    }
    else
    {
        if(Player[playerid][AdminLevel] >= 1)
        {
            if(CarCount < MAX_VEHICLES)
            {
                if(carid < 400 || carid > 611)
                {
                    SendClientMessage(playerid, ERROR, "ERROR: Valid car IDs start from 400, ending at 611.");
                    return 1;
                }

                GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
                physical_car_id = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, -1, -1, -1);
                ChangeVehicleColor(carid, c1, c2);

                SendClientMessage(playerid, WHITE, string);

                AdminSpawned[SpawnedVehicles] = physical_car_id;
                SpawnedVehicles++;

                PutPlayerInVehicle(playerid, physical_car_id, 0);
                LinkVehicleToInterior(physical_car_id, GetPlayerInterior(playerid));
                SetVehicleVirtualWorld(physical_car_id, GetPlayerVirtualWorld(playerid));
                new engine, lights, alarm, doors, bonnet, boot, objective;
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
            }
            else
            {
                SendClientMessage(playerid, WHITE, "Despawn the current spawned vehicles before spawning any more (or attempting to do so).");
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
/Spawncar is not functional - by nmader - 17.09.2012, 21:00
Re: /Spawncar is not functional - by antonio112 - 17.09.2012, 21:19
Re: /Spawncar is not functional - by nmader - 17.09.2012, 21:20
Re: /Spawncar is not functional - by antonio112 - 17.09.2012, 21:23
Re: /Spawncar is not functional - by nmader - 17.09.2012, 21:25
Re: /Spawncar is not functional - by antonio112 - 17.09.2012, 21:29
Re: /Spawncar is not functional - by nmader - 17.09.2012, 21:33
Re: /Spawncar is not functional - by antonio112 - 17.09.2012, 21:39
Re: /Spawncar is not functional - by nmader - 17.09.2012, 21:42
Re: /Spawncar is not functional - by antonio112 - 17.09.2012, 22:18

Forum Jump:


Users browsing this thread: 3 Guest(s)