FUEL for created cars with /car
#1

hello i got a fuel in GM and there is a code

this means, fuel for ongamemodeinitspawned cars
Код:
for(new c=0;c<MY_MAX_VEHICLE;c++) Gas[c] = 10+random(40);
and there is command for car create
Код:
dcmd_car(playerid, params[])
{
  if(IsPlayerConnected(playerid))
	{
	  if(strlen(params) > 24) return SendClientMessage(playerid, COLOR_RED, "CHYBA: /car [IDauta] [Barva1] [Barva 2]");
	  new pos,string[1024];
		if(adminlvl[playerid] < 2) SendClientMessage(playerid, COLOR_RED, "Nedostatečnэ administrбtorskэ level!");
		else if(!params[0]||!(pos=chrfind(' ',params)+1)||!(pos=chrfind(' ',params)+2)||!params[pos])
		{
     SendClientMessage(playerid, COLOR_RED, "CHYBA: /car [IDauta] [Barva1] [Barva 2]");
		}
		else if(ServerCFG[Car] == 10) SendClientMessage(playerid, COLOR_RED, "[10/10] Vozidlo nebylo vytvořeno, nejdřнve znič předchozн /destroy");
		else
		{
		  	new car = strval(params[0]);
			if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_RED, "Rozmezн aut je 400 - 611");
	    new color1 = strval(params[pos]);
			new color2 = strval(params[pos+1]);
			if(color1 > 126 || color1 < 0 || color2 > 126 || color2 < 0) return SendClientMessage(playerid, COLOR_YELLOW, "Rozmezн barev je 0 - 126");

			if(ServerCFG[Car] < 10)
			{
				new Float:Uhel,Float:X,Float:Y,Float:Z;
				GetPlayerFacingAngle(playerid,Uhel);
				GetPlayerPos(playerid, X,Y,Z);
				new link = GetPlayerInterior(playerid);
				InfrontOf(playerid, X, Y, 4.0);
				Ecar[ServerCFG[Car]] = CreateVehicle(car, X,Y,Z, Uhel+90, color1, color2, 600000);
				if(link > 0) LinkVehicleToInterior(Ecar[ServerCFG[Car]],link);
				format(string, sizeof(string), "[%d/10] Vozidlo bylo ъspěљně spawnuto, pro zničenн napiљ /destroy", ServerCFG[Car]+1);
				SendClientMessage(playerid, COLOR_BLUE, string);
				ServerCFG[Car]++;
			}
  		}
 	}
	return 1;
}
but when i create car there is no fuel work how to do that please hlp me
Reply


Messages In This Thread
FUEL for created cars with /car - by 666godspeed666 - 02.12.2009, 18:23

Forum Jump:


Users browsing this thread: 1 Guest(s)