Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Post here what you tried.
  2. It is moving the objects, but maybe you didn't want to move these, but the fence. gate = createObject ( 980, 2771.3999023438, -2417.8000488281, 15.39999961853, 0, 0, 270 ) allObjects = { createObject ( 3749, 2772, -2417.8000488281, 18.299999237061, 0, 0, 90 ), createObject ( 2909, 2798, -2430.1999511719, 14.60000038147, 0, 0, 90 ), createObject ( 2909, 2797.6000976563, -2405.3000488281, 14.60000038147, 0, 0, 90 ) } col = createColRectangle ( 2773.0812988281, -2422.6938476563, 2.75, 2 ) function hit ( ) moveObject ( gate, 100, 2771.3999023438, -2417.8000488281, 18 ) end addEventHandler ( "onColShapeHit", col, hit ) function leave ( ) moveObject ( gate, 15000, 2771.3999023438, -2417.8000488281, 15.39999961853 ) end addEventHandler ( "onColShapeLeave", col, leave )
  3. Castillo

    New Server Mods

    @e-Hate: You can use this map converter: viewtopic.php?f=140&t=38462
  4. You are using the latest update of "spawn" resource?
  5. MTA has many resources when you download it, including a resource called: "reload" which it does what you want.
  6. function warpMe(targetPlayer) if getElementData(targetPlayer,"warp.status") then outputChatBox ( "This player has disabled warping.", source, 255, 0, 0 ) return end ..
  7. That's because "allObjects" table is not defined anywhere. gate = createObject( 980, 2771.3999023438, -2417.8000488281, 15.39999961853, 0, 0, 270 ) allObjects = { createObject( 3749, 2772, -2417.8000488281, 18.299999237061, 0, 0, 90 ), createObject( 2909, 2798, -2430.1999511719, 14.60000038147, 0, 0, 90 ), createObject( 2909, 2797.6000976563, -2405.3000488281, 14.60000038147, 0, 0, 90 ) } col = createColRectangle( 2773.0812988281, -2422.6938476563, 2.75, 2 ) function hit() for key, gate in ipairs ( allObjects ) do moveObject( gate, 100, 2771.3999023438, -2417.8000488281, 18 ) end end addEventHandler("onColShapeHit", col, hit) function leave() moveObject( gate, 15000, 2771.3999023438, -2417.8000488281, 15.39999961853) end addEventHandler("onColShapeLeave", col, leave)
  8. Castillo

    help

    maybe try this function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 1000 ) end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) That won't work, because the player dies because his/her vehicle explodes.
  9. You must use: isGuestAccount
  10. Instead of the file path, you set the URL.
  11. addEventHandler("onColShapeHit", gate, hit) Here, you are attaching the event to the object, not to the colshape, it should be: addEventHandler("onColShapeHit", col, hit)
  12. viewtopic.php?f=13&t=45831
  13. 1: Te falto un 'end' en la funcion 'close'. 2: Usaste el mismo evento: "onMarkerHit" en vez de "onMarkerLeave". 3: Lee 1 y 2.
  14. Eso es porque no tiene sentido, ni siquiera definiste la funcion, ademas de que estas usando un elemento para el event handler, en lugar de una funcion. airportgate = createObject (980, 1759.5999755859, 552.59997558594, 27.700000762939, 0, 0, 340) MarkerOpen = createMarker (1761.3017578125, 571.13073730469, 24.565521240234, "cylinder",4, 255, 0, 0, 255) MarkerClose = createMarker (1749.8184814453, 531.37005615234, 27.262020111084,"cylinder",4, 255, 0, 0, 255) function abrir ( ) moveObject (airportgate, 5000, 1759.5999755859, 552.59997558594, 33.700000762939) end addEventHandler( "onMarkerHit", MarkerOpen, abrir) addEventHandler( "onMarkerHit", MarkerClose, abrir)
  15. Seems like the attribute "friendlyfire" is not being used at all. Replace all the content of: "s_main.lua" with this: g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local class = classGroups[ categoryIndex ].classes[ classIndex ]; if class.password then if not password or password == "" then triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; elseif password ~= class.password then outputChatBox( "The password you typed in is incorrect! Try again or cancel to choose different class.", client, 200, 50, 50 ); triggerClientEvent( client, "spawn_requestPassword", root, class.name ); return; end end local skin = class.skinMngr.skins[ skinIndex ]; local spawn = true; local spawned; --[[if not classGroups[ cetegoryIndex ].owner then -- if there is NO owner of the clan/gang spawn player spawn = true; else -- if there IS owner of the clan/gang then check if he's member of the clan/gang end]] if spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); setTeamFriendlyFire ( class.team, false ) end local plrTeam = getPlayerTeam( client ); if ( ( plrTeam ) and ( plrTeam ~= class.team ) and ( countPlayersInTeam( plrTeam ) == 1 ) ) then destroyElement( plrTeam ); end spawned = spawnPlayer( client, skin.spawnLoc.x, skin.spawnLoc.y, skin.spawnLoc.z, skin.spawnLoc.rot, skin.modelId, 0, 0, class.team ); end if spawned then setElementData( client, "team", class.name ) setElementData( client, "skin", skin.name ) fadeCamera( client, true ); setCameraTarget( client, client ); setTimer( setCameraTarget, 200, 1, client, client ); triggerClientEvent( client, "spawn_SpawnedSuccessfully", client ); --setPlayerMoney( client, 500 ); for _, weapon in ipairs( class.weaponMngr.weapons ) do giveWeapon( client, weapon.id, weapon.ammo, false ); end createBlipAttachedTo( client, 0, 2, class.color.red, class.color.green, class.color.blue ) else triggerClientEvent( client, "spawn_FailedToSpawn", client ); if countPlayersInTeam( class.team ) == 0 then destroyElement( class.team ); class.team = nil; end end end end ); addEvent( "spawn_receivePassword", true ); addEventHandler( "spawn_receivePassword", g_root, function( ) end ); addEventHandler( "onPlayerSpawn", g_root, function ( ) end ); addEventHandler( "onPlayerWasted", g_root, function( ) fadeCamera( source, false, 4 ); setTimer( requestMenu, 5000, 1, source ); deleteAllPlayerBlips( source ) end ); function requestMenu( player ) callClientFunc( player, "showSpawnMenu", true, true ); callClientFunc( player, "classSelected" ); end addCommandHandler( "kill", function( plr ) killPed( plr ); end ) function preloadClassesInfo( ) local groups = getElementsByType( "category" ); for _, group in ipairs( groups ) do table.insert( classGroups, Group:New( group ) ); end end addEventHandler( "onResourceStart", getResourceRootElement(), preloadClassesInfo ) function deleteAllPlayerBlips(player) local elements = getAttachedElements(player) if (elements) then for i, element in ipairs(elements) do if (getElementType(element) == "blip") then destroyElement(element) end end end print( "number of players in team: " .. tostring( countPlayersInTeam( getPlayerTeam( player ) ) ) ); end addEventHandler( "onPlayerQuit", g_root, function() deleteAllPlayerBlips(source) end ); ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ function callClientFunc( player, funcName, ... ) if #{ ... } ~= 0 then triggerClientEvent( player, "_clientCallFunction", root, funcName, ... ) else triggerClientEvent( player, "_clientCallFunction", root, funcName ) end end addEvent( "_serverCallFunction", true ) addEventHandler( "_serverCallFunction", root, function( funcName, ... ) _G[ funcName ](...) end )
  16. No estas ejecutando la funcion. Ponele despues del "end": addEventHandler ( "onClientResourceStart", resourceRoot, robada )
  17. Para hacer eso necesitas las siguientes funciones/eventos: Funciones: createObject moveObject createMarker o createColTube Eventos: onMarkerHit o onColShapeHit
  18. Stolen resource: https://community.multitheftauto.com/ind ... ls&id=5502 DONE
  19. That's different, since you'll need a different table because the script I posted is a lua table, removed when the resource stops/restarts.
  20. Castillo

    Teams

    You're welcome.
×
×
  • Create New...