Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. The function: "isPlayerAdmins" triggers a client event, right? if so, then you can use the same method you currently using and getKeyState on the client side, to make sure the second key is also pressed.
  2. function hasStringCharacters ( str ) return str:find ( "%p" ) end
  3. Castillo

    GUI

    bindKey interpolateBetween onClientRender
  4. Castillo

    help me pls

    addEvent ( "Ridex", true ) addEventHandler ( "Ridex", root, function ( ) triggerLatentClientEvent(source,"Serversend",100000,false,source,fine); end ) You forgot to close the function with a parentheses and an 'end'.
  5. addEventHandler ( "onClientPlayerSpawn", root, function ( ) local x, y, z = getElementPosition ( source ) setTimer ( createExplosion, 16000, 1, x, y, z, 10, true, -1.0, false ) end )
  6. The community is working fine, make sure the resource has exported functions ( server side ). P.S: I didn't "fix" it, since it was from GUIeditor by Remp, it couldn't exactly be stripped out, you had to take other parts to make it work, searching them is all I did.
  7. He has to use triggerServerEvent to take/fix it server side.
  8. No, you got me wrong, read this manual: https://wiki.multitheftauto.com/wiki/Resources
  9. Fort Carson Roleplay was built on valhalla scripts, which were leaked. Topic locked.
  10. Is the resource on the acl.xml?
  11. To set it as client side, when you add the script to the meta.xml, set type="client".
  12. Create a new resource, then put that code on a script file, then make a meta.xml for it and set it as client side, then start it, make sure "customblips" resource is already started.
  13. Castillo

    Help Server :(

    It's not required.
  14. Castillo

    getTickCount

    Tenes que restarle ese tiempo al tiempo de ahora.
  15. No errors on debug? is triggerClientEvent returning 'true'?
  16. local messagesList = { "Visite: SBGames.com.br", "X sobre um carro para grudar.", "Carregando...", "Desejamos a todos um Bom Jogo.", } local currentMessage = 1 -- ******************** -- * Event handlers * -- ******************** addEventHandler ( "onClientPreRender", getRootElement(), function ( ) local screenWidth, screenHeight = guiGetScreenSize ( ) -- Draw the news sticker. dxDrawRectangle ( screenWidth - 204, 4, 200, 20, tocolor(0, 0, 0, 192), false ) -- Draw all strings. dxDrawText ( messagesList [ currentMessage ], screenWidth - 202, 6, screenWidth - 6, 16, tocolor(255, 0, 0, 255), 1, "default-bold", "center", "top", false, false, false ) end ) function updateMessage ( ) if ( currentMessage >= #messagesList ) then currentMessage = 1 else currentMessage = ( currentMessage + 1 ) end end setTimer ( updateMessage, 5000, 0 ) Try that.
  17. Seriously? is that hard to understand? just put ANYTHING YOU WANT. Example: addCommandHandler ( "adminpanel", isPlayerAdmins )
  18. Estas cargando el mapa como un script, postea el contenido de meta.xml.
  19. I don't know, is your script, put anything you want.
  20. local eof = nil function outputPanelLog(outputs,comment) local panellog = nil if fileOpen ( "panellog.txt" ) then panellog = fileOpen ( "panellog.txt" ) eof = fileGetSize ( panellog ) fileSetPos ( panellog, eof ) else panellog = fileCreate ( "panellog.txt" ) end local time = getRealTime() local curTime = "[".. time.year+1900 .."-".. time.month+1 .."-"..time.monthday.." "..time.hour..":"..time.minute.."]" local str = outputs -- if string.len( comment ) > 0 then -- str = str .. "\\ " .. comment -- end str = str .. "\r\n" eof = fileWrite ( panellog, curTime .. " * FTAPANEL: " .. outputs .. "." .. "\n" ) fileSetPos ( panellog, eof ) fileClose ( panellog ) outputDebugString ( "Log Written" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then outputConsole ( " * FTAPANEL: " .. outputs .. ".", player ) end end end function getdxtxt ( motdt, _source) local logK = _source .. " set the dxMOTD to \"" .. motdt .. "\"" outputPanelLog(logK) for _, player in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( player, "rendertxt", player, motdt ) triggerClientEvent ( player, "setBox", player, motdt ) end motdhandle = fileCreate("motdk.txt") if motdhandle then fileWrite(motdhandle , motdt) fileFlush (motdhandle) fileClose(motdhandle) end end addEvent ( "getdx", true ) addEventHandler ( "getdx", root, getdxtxt ) function readfile() local openmotd = fileOpen("motdk.txt") local motdt = fileRead (openmotd, 100) triggerClientEvent ( source, "rendertxt", source, motdt ) triggerClientEvent ( source, "setBox", source, motdt ) fileClose(openmotd) end addEvent("joinmotd",true) addEventHandler("joinmotd", root, readfile) function isPlayerAdmins(source) if isPlayerAdmin (source) then triggerClientEvent("ClientGui",getRootElement(),source) end end addCommandHandler ( "COMMAND NAME HERE", isPlayerAdmins ) function isPlayerAdmin(source) local accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user." ..accountname, aclGetGroup("Admin")) then return true elseif isObjectInACLGroup("user." ..accountname, aclGetGroup("SuperModerator")) then return true end end function isPlayerInTeam( thePlayer, teamName ) local pTeam = getPlayerTeam( thePlayer ) local fTeam = getTeamName( teamName ) if ( pTeam ) and ( fTeam ) then if ( pTeam == fTeam ) then return true end end end function adminChat ( thePlayer, commandName, ... ) local text = table.concat ( { ... }, " " ) local playerName = getPlayerName ( thePlayer ) for _, player in ipairs ( getElementsByType ( "player" ) ) do if isPlayerAdmin ( player ) then outputChatBox ( "#FF0000[#CCCCCCAdmin#FF0000] #FF0000".. playerName .."#CCCCCC: #FF0000".. text, player, 255, 255, 255, true ) end end end addCommandHandler ( "ac", adminChat, true ) ----[Admin Display Server]---- function outputMessage(text) outputChatBox ("#FFD700Admin#FFFF00: "..text, getRootElement(), 255, 255, 255, true ) --output that text end addEvent("ServerOutput",true) addEventHandler("ServerOutput", root,outputMessage) ----[Hide Name Server]---- function hideNameTag ( source ) if isPlayerNametagShowing ( source ) == true then setPlayerNametagShowing ( source, false ) end end addEvent("hideName",true) addEventHandler("hideName", root,hideNameTag) function showNameTag ( source ) setPlayerNametagShowing ( source, true ) end addEvent("showName",true) addEventHandler("showName", root, showNameTag) ----[HideRadar Blip]---- function hideRadarBlip ( source ) for index, element in ipairs ( getAttachedElements ( source ) ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end addEvent("hideBlip",true) addEventHandler("hideBlip", resourceRoot,hideRadarBlip) function createRadarBlip ( source ) r = math.random(1,255) g = math.random(1,255) b = math.random(1,255) pBlip = createBlipAttachedTo ( source, 0, 2, r, g, b ) end addEvent("createBlips",true) addEventHandler("createBlips", resourceRoot, createRadarBlip) function destroyBlipsAttachedTo() local attached = getAttachedElements ( source ) if ( attached ) then for k,element in ipairs(attached) do if isElement ( element ) then if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end end addEventHandler ( "onPlayerQuit", getRootElement(), destroyBlipsAttachedTo ) ---- [invisibility - Player(ped)] ----- function invisible ( source ) if not ( getElementAlpha(source) == 0 ) then setElementAlpha ( source, 0 ) end end addEvent("noalpha",true) addEventHandler("noalpha", resourceRoot, invisible) function notinvisible ( source ) if ( getElementAlpha(source) == 0 ) then setElementAlpha ( source, 255 ) end end addEvent("noalpha1",true) addEventHandler("noalpha1", resourceRoot, notinvisible) ------------------ ---- Car Mods ---- ------------------ ---- [ God Mode ] ---- function nocardamage ( source ) if ( isPedInVehicle ( source ) ) then if ( isVehicleDamageProof ( getPedOccupiedVehicle ( source ) ) == false ) then setVehicleDamageProof ( getPedOccupiedVehicle ( source ), true ) end else outputChatBox ( "You must be inside a vehicle to set this.", source ) end end addEvent("cardamage", true ) addEventHandler("cardamage", resourceRoot, nocardamage ) function disabledamage ( source ) if ( isPedInVehicle ( source ) ) then setVehicleDamageProof ( getPedOccupiedVehicle ( source ), false ) end end addEvent("nodamage", true) addEventHandler("nodamage", resourceRoot, disabledamage ) ---- [Car Invisibility] ---- function carinvis(source) if not ( getElementAlpha ( getPedOccupiedVehicle ( source ) ) == 0 ) then setElementAlpha ( getPedOccupiedVehicle ( source ), 0 ) end end addEvent("nocaralpha",true) addEventHandler("nocaralpha", resourceRoot,carinvis) function tcarinvis(source) setElementAlpha ( getPedOccupiedVehicle ( source ), -1 ) end addEvent("nocaralpha1",true) addEventHandler("nocaralpha1", resourceRoot,tcarinvis) --- [Kill] --- function noElementHealth ( playerName, _source ) -- local comment = table.concat( arg, " " ) local logK = _source .. " killed " .. playerName outputPanelLog(logK) local _source = getPlayerFromName ( _source ) if isPlayerAdmin ( _source ) then local killed = setElementHealth ( getPlayerFromName ( playerName ), 0 ) end end addEvent("nohp", true) addEventHandler("nohp",resourceRoot, noElementHealth ) ---- [ Set Nametag Text ] ---- function setnametxt ( playerName, newNametagText ) setPlayerNametagText ( getPlayerFromName ( tostring(playerName) ), newNametagText ) end addEvent ("nametxt",true) addEventHandler("nametxt", resourceRoot, setnametxt ) ---- [ Lock / UnLock ] ---- function slock ( targetLock ) local targetvehicle = getPedOccupiedVehicle ( getPlayerFromName ( targetLock ) ) if ( targetvehicle ) then setVehicleLocked ( targetvehicle, true ) end end addEvent ("sslock",true) addEventHandler("sslock", resourceRoot, slock ) function sunlock ( targetunlock ) local targetsvehicle = getPedOccupiedVehicle ( getPlayerFromName ( targetunlock ) ) if ( targetsvehicle ) then setVehicleLocked ( targetsvehicle, false ) end end addEvent ("ssunlock",true) addEventHandler("ssunlock", resourceRoot, sunlock ) ---- [ Head/less ] ---- addEvent ("toghead",true) function headless( playerName ) if not (
×
×
  • Create New...