Command /veh makes the server crash.
#1

I have no idea why, the SERVER crashes.

Код:
command(veh, playerid, params[])
{
	new carid, string[128], Float: CarToX, Float: CarToY, Float: CarToZ, physical_car_id;
	if(sscanf(params, "d", carid))
	{
	    if(Player[playerid][AdminLevel] >= 3)
	    {
			SendClientMessage(playerid, WHITE, "Server:  /veh [vehicleid]");
		}
	}
	else
	{
		if(Player[playerid][AdminLevel] >= 3)
		{
	    	if(CarCount < MAX_VEHICLES)
	    	{
				if(carid < 400 || carid > 611)
				{
					SendClientMessage(playerid, WHITE, "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);
				format(string, sizeof(string), "PF11 %i", carid);
				SetVehicleNumberPlate(physical_car_id, string);
				SetVehicleToRespawn(physical_car_id);
				PutPlayerInVehicle(playerid, physical_car_id, 0);
				new vehid = GetPlayerVehicleID(playerid);
				format(string, sizeof(string), "[AdmCmd] %s has spawned a vehicle; Model ID: %d - Vehicle ID: %d", RemoveUnderScore(playerid), carid, vehid);
				SendToAdmins(RED, string, 0);
				fuel[physical_car_id] = 100;
				Player[playerid][KeyShare] = physical_car_id;
				LinkVehicleToInterior(physical_car_id, GetPlayerInterior(playerid));
				Engine[physical_car_id] = 0;
				Windows[physical_car_id] = 0;
				Siren[physical_car_id] = 0;
				SirenObject[physical_car_id] = 0;
				Lights[physical_car_id] = 0;
				AdminSpawned[physical_car_id] = 1;
		    }
		}
		else return SendClientMessage(playerid, GREY, "You must be on Admin Duty to perform this command.");
	}
	return 1;
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: 2 Guest(s)