SA-MP Forums Archive
how to make this command work faster in game? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to make this command work faster in game? (/showthread.php?tid=422581)



how to make this command work faster in game? - Dainyzxz - 14.03.2013

how i can make this code work faster in game ? because than I get in car(pizzaboy1) i can drive for while, and after around 3-10seconds i get out from car, how i can make it for get out from car in 1sec ?

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	new VehicleID = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER)
	{
	//Policininkas
	if(VehicleID == motociklas1 || VehicleID == motociklas2 || VehicleID == motociklas3 || VehicleID == motociklas4 || VehicleID == motociklas5 || VehicleID == motociklas6 || VehicleID == motociklas7 || VehicleID == motociklas8 || VehicleID == motociklas9 || VehicleID == motociklas10 || VehicleID == motociklas11 || VehicleID == motociklas12 || VehicleID == motociklas13 || VehicleID == motociklas14 || VehicleID == motociklas15 || VehicleID == motociklas16)
	{
		if(Policininkas[playerid] == 1)
		{
			return 1;
		}
		else
		{
			RemovePlayerFromVehicle(playerid);
			SendClientMessage(playerid,COLOR_RED, "Љis transportas priklauso policijai");
		}
	}
	//Picų iљveћiotojas
	if(VehicleID == pizzaboy1 || VehicleID == pizzaboy2 || VehicleID == pizzaboy3 || VehicleID == pizzaboy4 || VehicleID == pizzaboy5 || VehicleID == pizzaboy6 || VehicleID == pizzaboy7 || VehicleID == pizzaboy8 || VehicleID == pizzaboy9 || VehicleID == pizzaboy10 || VehicleID == pizzaboy11 || VehicleID == pizzaboy12 || VehicleID == pizzaboy13 || VehicleID == pizzaboy14 || VehicleID == pizzaboy15 || VehicleID == pizzaboy16 || VehicleID == pizzaboy17)
	{
			if(Picerijus[playerid] == 1)
			{
				return 1;
			}
			else
			{
				RemovePlayerFromVehicle(playerid);
			    SendClientMessage(playerid,COLOR_RED, "Љis transportas priklauso picų iљveћiotojams");
			}
		}
	}
	return 1;
}



Re: how to make this command work faster in game? - DiGiTaL_AnGeL - 14.03.2013

It may be because of your lag. Anyway. YCMD is the fastest command proccesor.