Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I'll lock the topic before someone answers to that post.
  2. function enterVehicle ( theVehicle, seat, jacked ) setVehicleColor ( theVehicle, 0, 255, 0, 0 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) Te aconsejo empezar con TODO lo basico de Lua y tambien su sintaxis.
  3. No, porque al iniciar el mapa on tienen los vehiculos, usa onPlayerVehicleEnter.
  4. addEventHandler ( "onPlayerJoin", root, function ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then setVehicleColor ( vehicle, 0, 255, 0, 0 ) end end ) Esto no te va a funcionar igual, ya que cuando un jugador entra al servidor, no tiene vehiculo, talves deberias usar el evento para cuando un jugador entra en un vehicle: onPlayerVehicleEnter.
  5. Castillo

    Script Problem

    Copy my code again.
  6. Castillo

    GetSkin

    You're welcome.
  7. Castillo

    GetSkin

    What you said makes totally no sense. local playermoney = 600 addEvent ( "GetSkin", true ) addEventHandler ( "GetSkin", getRootElement(), function ( modelo ) local g_playerMoney = getPlayerMoney ( source ) if ( g_playerMoney >= playermoney ) then setElementModel ( source, tonumber ( modelo ) ) takePlayerMoney ( source, tonumber ( playermoney ) ) end end )
  8. A GUI is just another element, you can destroy it with destroyElement.
  9. Castillo

    Script Problem

    function chatbox ( text, msgtype ) local account = getAccountName ( getPlayerAccount ( source ) ) local name = getPlayerName ( source ) if ( msgtype == 0 ) then if isObjectInACLGroup ( "user." .. account, aclGetGroup ( "SuperModerator" ) ) then outputChatBox ( "#DD23D4[sMOD] #DD23D4" .. name ..":#DD23D4 " .. text, root, 255, 255, 255, true ) outputServerLog ( "CHAT: [sMOD] " .. name .. ": " .. text ) elseif isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Moderator" ) ) then outputChatBox ( "#F4F82C[MOD] #F4F82C".. name .. ":#F4F82C " .. text, root, 255, 255, 255, true ) outputServerLog ( "CHAT: [MOD] " .. name .. ": " .. text ) else local message = string.gsub ( text, "#%x%x%x%x%x%x", "" ) local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( name ..": ".. message, getRootElement(), r, g, b, true ) end cancelEvent ( true ) elseif ( msgtype == 2 ) then end end addEventHandler ( "onPlayerChat", root, chatbox ) Try that.
  10. No estoy seguro, pero se puede usar para que los objetos destructibles no se puedan destruir.
  11. viewtopic.php?f=145&t=45084
  12. Also remember that trains sync is not that good.
  13. You could set a special element data to these you want to blow up and not respawn and then check it when going to respawn.
  14. Castillo

    Login Panel

    Do you expect us to guess your problem?
  15. --if you still remember, it tells the zoneowner if there is a player in it, now i want to change it so it only tells a person in the team "Street Racers" that there is a player in the "Police Officers" Team nearby when a player from the "Police Officers" team steps in the collision. local playerZones = { } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do playerZones [ player ] = createColTube ( 0, 0, 0, 10.0, 100.0 ) attachElements ( playerZones [ player ], player, 0, 0, 0 ) setElementData ( playerZones [ player ], "zoneOwner", player ) addEventHandler ( "onColShapeHit", playerZones [ player ], zoneEnter ) end end ) function createZone ( ) playerZones [ source ] = createColTube ( 0, 0, 0, 10.0, 100.0 ) attachElements ( playerZones [ source ], source, 0, 0, 0 ) setElementData ( playerZones [ source ], "zoneOwner", source ) addEventHandler ( "onColShapeHit", playerZones [ source ], zoneEnter ) playerTeam = getTeamName ( getPlayerTeam ( source ) ) outputChatBox ( playerTeam, source ) end addEventHandler ( "onPlayerJoin", root, createZone ) addEventHandler ( "onPlayerSpawn", root, createZone ) function destroyZone ( ) if ( isElement ( playerZones [ source ] ) ) then destroyElement ( playerZones [ source ] ) end end addEventHandler ( "onPlayerQuit", root, destroyZone ) function zoneEnter ( hitElement ) local zoneOwner = getElementData ( source, "zoneOwner" ) if ( zoneOwner ~= hitElement ) then outputChatBox ( "There is a player in your zone!", zoneOwner ) end end function giveMoney ( ) for index, player in ipairs ( getElementsWithinColShape ( playerZone, "player" ) ) do givePlayerMoney ( player, 5000 ) outputChatBox ("Congratulations, you have been rewarded $5000 for capturing " .. root ,player) destroyZone() end end addEventHandler ( "onPlayerWasted", root, giveMoney )
  16. Castillo

    Misiones

    Lo estas usando mal, getPlayerLevel obtiene el nivel de un jugador, no lo compara. if ( exports.exp_system:getPlayerLevel ( source ) >= 10 ) then Eso tenes que usar. >= quiere decir igual o mayor a.
  17. if ( zoneOwner ) == false then Why you set "== false"?? that'll check if the zone doesn't has a owner, remove "== false".
  18. Use the function: getVehicleController to get the vehicle driver.
×
×
  • Create New...