Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. GUI labels doesn't support color coded, you'll have to make your own function, there's one around the forum which creates many labels to simulate multi color.
  2. I loaded that same code on my local server and it didn't cause any error. Do you have it set as a client side script on meta.xml?
  3. There's also an example for updating data: dbExec( connection, "UPDATE ?? SET ??=?", tableName, columnName, columnValue )
  4. There's an example on the wiki about inserting with SQlite: dbExec( connection, "INSERT INTO table_name VALUES (?,?,?)", "aaa", "bbb", 10 )
  5. Mind posting the complete code?
  6. Castillo

    aclGetGroup

    Since he's using a defined argument server side, he must trigger localPlayer twice. triggerServerEvent ( "setteam", localPlayer, localPlayer )
  7. If you give money client side, the money will not be synced with the server side, you must give/take it server side only.
  8. Castillo

    codigos html

    Usa: getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" )
  9. Castillo

    aclGetGroup

    Show us how you trigger it.
  10. Castillo

    Help GUI!

    onClientClick guiSetVisible
  11. I see the answers and I see that he won't be getting what he wants. Topic locked.
  12. Castillo

    who created MTA SA

    Many people did, they are called The MTA Team. memberlist.php?mode=group&g=10
  13. Castillo

    gate help

    getPlayerTeam getTeamName
  14. Castillo

    gate help

    local gate = createObject ( 971, 1535, -1451, 14, 0, 0, 0.27014160156 ) local marker = createMarker ( 1535, -1450, 14, "cylinder", 6, 255, 255, 255, 0 ) function moveGate ( hitPlayer, matchingDimension ) if ( getElementType ( hitPlayer ) == "player" ) and ( getElementModel ( hitPlayer ) == 217 ) then moveObject ( gate, 2000, 1535, -1451, 7 ) setTimer ( moveBack, 2000, 1 ) end end addEventHandler ( "onMarkerHit", marker, moveGate ) function moveBack ( ) moveObject ( gate, 2000, 1535.02056884766, -1451.98352050781, 14.239881515503 ) end
  15. local gate = createObject(971, 1535, -1451, 14, 0, 0, 0.27014160156) local marker = createMarker(1535, -1450, 14, "cylinder", 6, 255, 255, 255, 0) function moveGate(hitPlayer, matchingDimension) if (getElementType(hitPlayer) == "player") and matchingDimension then if (getElementData(hitPlayer, "gang") == "Grove") then moveObject(gate, 2000, 1535, -1451, 7) setTimer(moveBack, 2000, 1) end end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 2000, 1535, -1451, 14) end Use that.
  16. I guess you are not using my "gang_system", because if you are, then you must get 'gang' element data instead. local gate = createObject(971, 1535, -1451, 14, 0, 0, 0.27014160156) local marker = createMarker(1535, -1450, 14, "cylinder", 6, 255, 255, 255, 0) function moveGate(hitPlayer, matchingDimension) if (getElementType(hitPlayer) == "player") and matchingDimension then if (getElementData(hitPlayer, "group") == "Grove") then moveObject(gate, 2000, 1535, -1451, 7) setTimer(moveBack, 2000, 1) end end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 2000, 1535, -1451, 14) end Try that.
  17. g_root = getRootElement( ); classGroups = { }; addEvent( "spawn_clientRequestSpawn", true ); addEventHandler( "spawn_clientRequestSpawn", g_root, function( categoryIndex, classIndex, skinIndex, password ) if skinIndex then local accName = getAccountName ( getPlayerAccount ( client ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) 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 spawn then if not class.team then class.team = createTeam( class.name, class.color.red, class.color.green, class.color.blue ); 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 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 )
  18. Castillo

    aclGetGroup

    And what is the problem?
  19. There's this: https://community.multitheftauto.com/ind ... ils&id=672 But you must spawn them manually. And with this game mode you can play with these bots: https://community.multitheftauto.com/ind ... ils&id=682
×
×
  • Create New...