Jump to content
  • 0

pomoc Vozidlo


arci224

Dotaz

Takže další problém mám ale když vystoupim tak se vozilo respawne automaticky ale nedalo by se uělat aby se automaticky zníčilo ?

CMD:acar(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_WARNING, "[  !  ] {FFFFFF}Nejsi Administrátor !"); //Another way to give the player the perimission
	if(PlayerInfo[playerid][pAdmin] == 1) return SendClientMessage(playerid, COLOR_WARNING, "[  !  ] {FFFFFF} Na použití potřeješ alespoň Admin Level - 2 !");
	new car;
	new string[128];
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
		if(Vehicle[playerid] != 0)
	    {
	    	DestroyVehicle(Vehicle[playerid]);
	    }
	 	Vehicle[playerid] = CreateVehicle(522, X, Y, Z + 2.0, 0, -1, -1, 1);
		format(string,sizeof(string),"Vyvolal jsi Admin Motorku, pro zníčení napiš /destroy (POUZE V ADMIN MOTO - NRG-500)!",car);
		SendClientMessage(playerid, COLOR_BLUE, string);
		PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
return 1;
}
Link to comment
Share on other sites

5 odpovědí na tuto otázku

Recommended Posts

  • 0

Tento public u sebe nemam

 

 

--- v FS to mam:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(IsPlayerInAnyVehicle(playerid) && !IsBicycle(GetPlayerVehicleID(playerid)))
	{
		//TextDrawShowForPlayer(playerid, SpeedoBox);
		TextDrawShowForPlayer(playerid, SpeedoText[playerid]);
		new vehicleid = GetPlayerVehicleID(playerid);
		if(VehicleSecurity[vehicleid] == 1)
		{
			ToggleAlarm(vehicleid, VEHICLE_PARAMS_ON);
			SetTimerEx("StopAlarm", ALARM_TIME, false, "d", vehicleid);
		}
	}
	else
	{
		//TextDrawHideForPlayer(playerid, SpeedoBox);
		TextDrawHideForPlayer(playerid, SpeedoText[playerid]);
	}
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new id = GetVehicleID(vehicleid);
		if(IsValidVehicle(id))
		{
			if(VehicleCreated[id] == VEHICLE_DEALERSHIP)
			{
				SetPVarInt(playerid, "DialogValue1", id);
				ShowDialog(playerid, DIALOG_VEHICLE_BUY);
				return 1;
			}
		}
		if(IsBicycle(vehicleid))
		{
			ToggleEngine(vehicleid, VEHICLE_PARAMS_ON);
		}
		if(Fuel[vehicleid] <= 0)
		{
			ToggleEngine(vehicleid, VEHICLE_PARAMS_OFF);
		}
	}
	return 1;
}
Edited by arci224
Link to comment
Share on other sites

  • 0

new car; tam mas uplne k nicemu

 

aby se auto znicilo staci treba v publicu onplayerexitvehicle porovnat jestli se vehicleid == Vehicle[playerid] a pokud ano tak vyvolat funkci na zniceni vozidla a nastavit Vehicle[playerid] = 0;

Link to comment
Share on other sites

  • 0

jenom poznamka, prihod si tam este pod Destroy

 

Vehicle[playerid] == 0;

 

aby ti to pak omylem nenicilo jiny vozidla. je to takova jistota

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...