AlexCelTare Posted October 23, 2022 Posted October 23, 2022 { new Float:health; new veh = GetPlayerVehicleID(playerid); GetVehicleHealth(veh, health); if(health > 500) return SendClientMessage(playerid, COLOR_RED, "Engine cannot start!"); } salut ma puteti ajuta, vreau sa fac o chestie, cand vehiculul are sub 500 viata, sa nu mai mearga vehiculul. stiti voi la ce ma refer
iamCibu Posted October 23, 2022 Posted October 23, 2022 Incearca sa pui if(health < 500) return SendClientMessage(playerid, COLOR_RED, "Engine cannot start!"); Verifici cand pornesti motorul daca HP-ul vehiculului este mai mic decat 500 atunci sa iti returneze mesajul respectiv.
AlexCelTare Posted October 23, 2022 Author Posted October 23, 2022 si cum pot face sa nu poata masina sa plece de pe loc? gen deloc
MiritaXD Posted October 23, 2022 Posted October 23, 2022 Adaugi la un timer "SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);" daca are sub 500 Hp
AlexCelTare Posted October 23, 2022 Author Posted October 23, 2022 51 minutes ago, MiritaXD said: Adaugi la un timer "SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);" daca are sub 500 Hp ok dar am deja comanda de /engine, ei daca dau /engine, pot porni?
MiritaXD Posted October 23, 2022 Posted October 23, 2022 Ai deja asta, dar daca este motorul pornit poti merge cu masina.. Daca atasezi aia de mai sus la un timer o sa-ti opreasca motorul daca este pornit(trebuie facuta si o verificare daca e oprit sa nu ruleze functia aiurea) if(health < 500) return SendClientMessage(playerid, COLOR_RED, "Engine cannot start!");
AlexCelTare Posted October 23, 2022 Author Posted October 23, 2022 { SendClientMessage(playerid, 0xFFCCCC, "(IN-CAR)*Press 2 or type /engine to start/stop vehicle engine.*"); SendClientMessage(playerid, 0xFFCCCC, "(IN-CAR)*Type /lights to enable/disable vehicle lights.*"); SendClientMessage(playerid, 0xFFCCCC, "(IN-CAR)*Type /seatbelt to enable/disable your seatbelt.*"); new Float:health; new veh = GetPlayerVehicleID(playerid); GetVehicleHealth(veh, health); if(health < 430) return SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF, 0, 0, 0, 0, 0, 0); SendClientMessage(playerid, COLOR_RED, "Engine has serious problems! Please Call A Mechanic!"); return 1; } acuma ideea e ca merge, dar idee e ca nu prea merge verificarea, intru in masina, si chiar daca ea are 1000 hp, tot ruleaza functia.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now