[Pedido] Como criar carros in game
#3

Код:
CMD:veh(playerid, params[])
    {
	 		if (PlayerInfo[playerid][pAdmin] >= 5)
	 		{
       			if(!admtrampando[playerid])
					return SendClientMessage(playerid, COLOR_GRAD1, " Vocк nгo pode usar este comando, pois nгo estб em modo trabalho!");

				if(CreatedCar >= 100)
	    		{
	    			SendClientMessage(playerid, COLOR_GRAD1, "Jб criaram muitos carros, destrua alguns primeiro /destruirid");
	    			return true;
	    		}
	   			new car, COLOR1, COLOR2;
	   			if(sscanf(params, "ddd", car, COLOR1, COLOR2))
	   			{
	    			SendClientMessage(playerid, COLOR_GRAD2, "USE: /veh [IDCARRO] [COR1] [COR2]");
	    			return true;
	   			}
        	    new string[128];
                if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "   Modelo Do Carro Tem Que Ser Entre 411 e 600 !"); return true; }
			   	if(COLOR1 < 0 || COLOR1 > 236) { SendClientMessage(playerid, COLOR_GREY, "   Nъmero Da Cor tem que ser entre 0 e 126 !"); return true; }
	   			if(COLOR2 < 0 || COLOR2 > 236) { SendClientMessage(playerid, COLOR_GREY, "   Nъmero Da Cor tem que ser entre 0 e 126 !"); return true; }
	   			new Float:X,Float:Y,Float:Z;
	   			GetPlayerPos(playerid, X,Y,Z);
				new str[74];
				new intir = GetPlayerInterior(playerid);
	   			new carid = CreateVehicle(car, X,Y+2,Z, 0.0, COLOR1, COLOR2, 60000);
	   			Gas[carid] = 99;
				new mot, lu, alar, por, cap, porma, ob;
	   			CreatedCars[CreatedCar] = carid;
	   			CreatedCar ++;
	   			GetVehicleParamsEx(carid, mot, lu, alar, por, cap, porma, ob);
	      		SetVehicleParamsEx(carid, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
	      		GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "AdmCmd: O admin %s criou um veнculo de [ID: %d e Modelo: %d]", sendername,carid, car);
                ABroadCast(COLOR_LIGHTGREEN,string,1);
	   			format(string, sizeof(string), "%s criou um carro id: %d no servidor ",sendername, car);
	   			BSPLogs("comandosadmin", string);
	   			TextoCarros[carid] = 1;
	      		format(str, sizeof str, "{FF0000}BSP-%04d", carid);
   				SetVehicleNumberPlate(carid, str);
		    	SetVehicleToRespawn(carid);
		    	LinkVehicleToInterior(carid, intir);
			}
  			return true;
 	}
Modo de funcionamento!

/veh IDDOVEICULO COR1 COR2
Reply


Messages In This Thread
Como criar carros in game - by ThiagoMikael - 25.09.2017, 00:24
Re: Como criar carros in game - by C4rtm4n - 25.09.2017, 00:26
Re: Como criar carros in game - by yFrank - 25.09.2017, 00:38
Re: Como criar carros in game - by RuanPereira - 25.09.2017, 00:42
Re: Como criar carros in game - by C4rtm4n - 25.09.2017, 00:55
Re: Como criar carros in game - by ThiagoMikael - 25.09.2017, 15:00
Re: Como criar carros in game - by C4rtm4n - 25.09.2017, 15:10
Re: Como criar carros in game - by ThiagoMikael - 25.09.2017, 15:41
Re: Como criar carros in game - by C4rtm4n - 25.09.2017, 15:46
Re: Como criar carros in game - by IlanZ - 25.09.2017, 21:02

Forum Jump:


Users browsing this thread: 1 Guest(s)