Jump to content

Game⚠Breakerツ

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Game⚠Breakerツ

  1. Close this Topic, problem Solved by myself lol. Anyways thank you ALw7sH.
  2. What is the code for counting number of players in a zone, and what is the difference between these? math.count (##...##) local count = math.count(1,2,3,4,5,6) assert(count == 6) and string.count int string.count(string text, string search) One thing I understood about string.count is it is an option to search and count "[ ]-Alphabet" to get no. of alphabets in text "[ ]-Text".
  3. Post full code here i need to check sth. Fixed it, actually forgot to add that 2nd argument. Sorry and Thank you very much
  4. You need to check the player seat , try this function vehicleEntry (playerSource,seat) if seat == 0 then if damageProofPlayers[playerSource] then setVehicleDamageProof(source,true) end end end addEventHandler ("onVehicleEnter", root, vehicleEntry) Doesnt work!
  5. Sure ! But a small doubt. function vehicleEntry (playerSource) if not getVehicleOccupant(source, 0) then return elseif damageProofPlayers[playerSource] then setVehicleDamageProof(source,true) end end addEventHandler ("onVehicleEnter", root, vehicleEntry) If a guy enabled cargodmode and enter others vehicle as passenger, i want to cancel that function from happening can you solve it pls.
  6. Awsome friend it works! I am so glad that you did it for me
  7. This was the code i were using before: function random1(playerSource) addEventHandler ("onVehicleEnter", root, vehicleEntry) end function random2(playerSource) removeEventHandler ("onVehicleEnter", root, vehicleEntry) end function vehicleEntry (playerSource) setVehicleDamageProof(getPedOccupiedVehicle(playerSource),true) end but the problem is when the function (random1) is enabled second time, I get an error: Bad usage @ 'addEventHandler' ['onVehicleEnter' with this function is already handled] So to avoid it I want to find another way on event handling.
  8. ---look on resource start, i want it to be normal onVehicleEnter damage proof is not enabled ---But when this function (random1) is Enabled, then I want damage proof enabled onVehicleEnter. function random1(playerSource) ---damageproof onVehicleEnter should be automatically enabled when this function is enabled ---note that there are some other functions other than for cars which i cannot post end function random2(playerSource) ---damageproof onVehicleEnter should be automatically disabled when this function is enabled ---note that there are some other functions other than for cars which i cannot post end function vehicleEntry (playerSource) setVehicleDamageProof(getPedOccupiedVehicle(playerSource),true) addEventHandler ("onVehicleEnter", root, vehicleEntry) ---Dont worry about how I set (random1) and (random2) functions enabled.. just help me
  9. ---on resource start i want damageproof disabled as default. function carGodMode(playerSource) ---i have my functions here which i cant post end function carNoGodMode(playerSource) ---i have my functions here which i cant post end function vehicleEntry (playerSource) if function carGodMode then setVehicleDamageProof(getPedOccupiedVehicle(playerSource),true) elseif function carNoGodMode then setVehicleDamageProof(getPedOccupiedVehicle(playerSource),false) end addEventHandler ("onVehicleEnter", root, vehicleEntry)
  10. I will make it simple, addEventHandler only when other function is enabled, else if that function is disabled cancel that event. And when the resource start I want it to be false.
  11. No, when I use this: addEventHandler ("onPlayerVehicleEnter", root, vehicleEntry) It automatically start the function vehicleEntry when resource started. But i want this event(vehicleEntry function) to start only when other function started. Hope you understand.
  12. Hi. How to trigger event only when a function is enabled.
×
×
  • Create New...