Command /veh makes the server crash.
#3

Try using this simple command I designed for my script!

pawn Код:
CMD:veh(playerid, params[]) {
    if (PlayerInfo[playerid][pAdmin] >= 4) {

        new
            iVehicle,
            iColors[2];

        if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /veh [model ID] [color 1] [color 2]");
        }
        else if(!(400 <= iVehicle <= 611)) {
            SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
        }
        else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
            SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid colour specified (IDs start at 0, and end at 255).");
        }
        else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {

            new
                Float: fVehPos[4];

            GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
            GetPlayerFacingAngle(playerid, fVehPos[3]);
            CreatedCars[iIterator] = CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
            VehicleFuel[CreatedCars[iIterator]] = 100.0;
            LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
            return SendClientMessageEx(playerid, COLOR_WHITE, "[SERVER]Vehicle spawned!");
        }
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    return 1;
}
+Rep if it helps you
Reply


Messages In This Thread
Command /veh makes the server crash. - by GordonP - 29.09.2012, 18:30
Re: Command /veh makes the server crash. - by Patrick - 29.09.2012, 18:41
Re: Command /veh makes the server crash. - by ShawnMiller1337 - 29.09.2012, 19:17
Re: Command /veh makes the server crash. - by GordonP - 30.09.2012, 00:37
Re: Command /veh makes the server crash. - by Rapk1d - 30.09.2012, 02:07

Forum Jump:


Users browsing this thread: 1 Guest(s)