Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Ayudaaaaaa

    addCommandHandler isObjectInACLGroup getPlayerFromName setPlayerTeam
  2. Castillo

    mySQL

    You're welcome.
  3. Castillo

    mySQL

    These functions are for MySQL and SQLite, you can choose between one of these types and start learning their syntax.
  4. Castillo

    mySQL

    dbConnect dbExec dbQuery dbPoll dbFree
  5. Castillo

    FPS Scoreboard

    local counter = 0 local starttick local currenttick addEventHandler ( "onClientRender", root, function ( ) if ( not starttick ) then starttick = getTickCount ( ) end counter = ( counter + 1 ) currenttick = getTickCount ( ) if ( currenttick - starttick >= 1000 ) then setElementData ( localPlayer, "FPS", counter ) -- Aca pusiste "fps", pero el nombre de tu columna es "FPS". counter = 0 starttick = false end end ) Lee el comentario que puse.
  6. Have you checked the link to the resource I posted?
  7. https://community.multitheftauto.com/ind ... ls&id=1152
  8. Aca no hacemos peticiones, vos pedis ayuda, nosotros te ayudamos.
  9. local runner = nil function toggleRun ( key, state ) if ( getKeyState ( "w" ) == true ) and ( state == "down" ) then if isTimer ( runner ) then killTimer ( runner ) end runner = setTimer ( setControlState, 200, 0, "sprint", not getControlState ( "sprint" ) ) elseif ( state == "up" ) then if isTimer ( runner ) then killTimer ( runner ) end end end bindKey ( "space", "down", toggleRun ) function reBind ( ) bindKey ( "space", "down", toggleRun ) end function playerPressedKey ( button, press ) if ( press ) then if ( button == "space" ) then -- You must check if the key pressed is "space", not space without "". if ( not isChatBoxActive ( ) ) then if ( hitspace == 0 ) then hitspace = 1 else unbindKey ( "space" ) setTimer ( reBind, 5000, 1 ) end end end end end addEventHandler ( "onClientKey", root, playerPressedKey ) Read comment.
  10. Castillo

    VEHICULOS

    onVehicleExplode + setElementDimension. Clickea esos links y lee como funcionan.
  11. Podes usar esta funcion para obtener los jugadores dentro de un colshape: https://wiki.multitheftauto.com/wiki/Get ... inColShape
  12. I don't understand what do you mean, you want to stop the player from running? if so you can use toggleControl.
  13. Castillo

    Tema pasado

    Ami me funciono a la perfeccion.
  14. Castillo

    Tema pasado

    exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset ( thePlayer ) exports [ "exp_system" ]:setPlayerEXP ( thePlayer, 0 ) exports [ "exp_system" ]:setPlayerLevel ( thePlayer, 1 ) local res = tonumber ( getElementData ( thePlayer, "reset" ) ) or 0 setElementData ( thePlayer, "reset", res + 1 ) end addCommandHandler ( "Reset", reset ) function respawn ( ) setElementData ( source, "reset", 0 ) end addEventHandler ( "onPlayerJoin", getRootElement(), respawn ) Acordate de que es server side.
  15. Con todos lo elementos GUI, si es una static image, entonces claro que funcionara.
  16. Awesome, I'll download it right now. Welcome back by the way .
  17. http://www.troubleshooters.com/codecorn ... and_Elseif
  18. Con que imagenes? solo funciona con elementos GUI.
  19. triggerClientEvent + playSound
  20. function globalOOC(thePlayer, commandName, ...) local logged = tonumber(getElementData(thePlayer, "loggedin")) if (logged==1) then if not (...) then outputChatBox("SYNTAX: /" .. commandName .. " [Message]", thePlayer, 255, 194, 14) else local oocEnabled = exports.global:getOOCState() message = table.concat({...}, " ") local muted = getElementData(thePlayer, "muted") if (oocEnabled==0) and not (exports.global:isPlayerAdmin(thePlayer)) then outputChatBox("OOC Chat is currently disabled.", thePlayer, 255, 0, 0) elseif (muted==1) then outputChatBox("You are currenty muted from the OOC Chat.", thePlayer, 255, 0, 0) else local players = exports.pool:getPoolElementsByType("player") local playerName = getPlayerName(thePlayer) local playerID = getElementData(thePlayer, "playerid") exports.logs:logMessage("[OOC: Global Chat] " .. playerName .. ": " .. message, 1) for k, arrayPlayer in ipairs(players) do local logged = tonumber(getElementData(arrayPlayer, "loggedin")) local targetOOCEnabled = getElementData(arrayPlayer, "globalooc") local adminlevel = exports.global:getPlayerAdminLevel(thePlayer) local gmlevel = exports.global:getPlayerGMLevel(thePlayer) title = exports.global:getPlayerAdminTitle(thePlayer) gmtitle = exports.global:getPlayerGMTitle(thePlayer) if adminlevel >= 4 then color = "#CC0000" else color = "#00ff00" end if gmlevel >= 4 then color1 = "#CC0000" else color1 = "#00ff00" end if adminlevel == 0 or getElementData(thePlayer,"hiddenadmin") == 1 then title = false end if exports.global:getPlayerDonatorLevel(thePlayer) > 0 and exports.global:getPlayerAdminLevel(thePlayer) == 0 and exports.global:getPlayerGMLevel(thePlayer) == 0 then color = "#CC9933" title = "Donator" end if (logged==1) and (targetOOCEnabled==1) then if title and color then outputChatBox("(( [GOOC] (" .. playerID .. ") ["..color.."" ..title.. "#ffe4c4] " .. playerName .. ": " .. message.." ))",arrayPlayer, 255,228,196,true) elseif gmtitle and color1 then outputChatBox("(( [GOOC] (" .. playerID .. ") ["..color1.."" ..gmtitle.. "#ffe4c4] " .. playerName .. ": " .. message.." ))",arrayPlayer, 255,228,196,true) else -- This has to go after 'elseif'. outputChatBox("(( [GOOC] (" .. playerID .. ") " .. playerName .. ": " .. message.." ))", arrayPlayer, 255,228,196,true) end end end end end end end addCommandHandler("o", globalOOC, false, false) addCommandHandler("GlobalOOC", globalOOC) Read comment.
×
×
  • Create New...