Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. You must edit the acl.xml with the server closed.
  2. You could set the current vehicle model and set his position instead of creating a new one.
  3. You can get the nearest vehicle to the player, then lock or unlock it.
  4. Upload the resource to mediafire.com and post the link. P.S: You may want to try this resource: https://community.multitheftauto.com/ind ... ls&id=3016 it's a mod loader, you can easily replace skins/weapons/vehicles.
  5. function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then if ( isTimer ( beachturfTimer ) ) then return end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( ) local beachTurfCplayers = getElementColShape ( beachTurfC ) local players = getElementsWithinColShape ( beachTurfC, "player" ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) for _, player in ipairs ( players ) do exports ["guimessages"] : outputServer ( player, "Congratulations, your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) end setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf )
  6. What do you mean? that all your vehicles are being multiplied?
  7. Estas seguro de que pusiste el script para crear el fuego como client side en el meta.xml?
  8. Lo pasado pisado, empezemos de nuevo y listo.
  9. Bueno, mejoren su actitud, porque el solo posteo un cancion, si no les gusta, lo dicen de buena manera.
  10. playSound3D That's what you want?
  11. That's because "v" and "vehicle" is not defined, also, I don't see why you need to loop all vehicles, you can just attach it to "root". addEventHandler ( "onVehicleEnter", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end ) addEventHandler ( "onVehicleExit", root, function ( player ) setVehicleEngineState ( source, getElementData ( source, "vehicle.engine" ) ) end )
  12. No, "players" is a table of elements, you must loop it.
  13. getElementColShape -- To obtain marker colshape. getElementsWithinColShape -- To obtain a table with player elements inside colshape.
  14. You forgot to pass the player argument here: beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) Like this: ,10000, 1, player
  15. The problem is on the colshape, you set negative size, that made the colshape to create wrong. local beachTurfA = createRadarArea( 352.93, -2025.23, 58, 65, 255, 255, 255, 125 ) local beachTurfC = createColRectangle ( 352.93, -2025.23, 58, 65 ) function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf )
  16. Have you tried debugging your script to find out where the problem is?
  17. And it doesn't say anything on chat box either?
  18. function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1 ) else outputChatBox ( "YOU ARE NOT IN A GANG!" ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf ) Try that and see what it outputs.
  19. Do you get any errors?
  20. Errors on debugscript? did you set it client side on meta.xml?
  21. getGangColor returns a table, you must unpack it. function beachTurf(player) if (getElementData( player, "gang" )) then local playerGang = getElementData( player, "gang" ) if (playerGang) then outputChatBox('executed', player, 255, 255, 255) else outputChatBox('failed',player,255,255,255) end local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function(player) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end, 10000, 1 ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf )
×
×
  • Create New...