-
Posts
1,102 -
Joined
Everything posted by Enargy,
-
--- you need to getServerPort () triggerClientEvent()
-
server.lua function setDataOnLogin() if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount( source )),aclGetGroup ( "Console" )) then setElementData(source, "showImage", true) end end addEventHandler("onPlayerLogin", root, setDataOnLogin) function setDataOnResourceStart() for i, v in ipairs(getElementsByType("player")) do if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount ( v )), aclGetGroup ( "Console" )) then setElementData(v, "showImage", true) end end end addEventHandler("onResourceStart", resourceRoot, setDataOnResourceStart) function removeDataOnLogout() setElementData(source, "showImage", false) end addEventHandler("onPlayerLogout", root, removeDataOnLogout) client.lua function showImage() if getElementData(getLocalPlayer(), "showImage") then dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "vip.png" ) else dxDrawImage ( sx + math.max(nameWidth/2, teamWidth/2) + 0*scale, sy - imageSize, imageSize, imageSize, "player.png" ) end end addEventHandler("onClientRender", root, showImage)
-
can you post all the code please?
-
oh, you are also leaving functions without arguments.
-
isObjectInACLGroup -- This function only works in server-side. you must check the '/debugscript 3' for more errors
-
why? WARNING: Access Denied @ 'setPlayerMuted' localTime = {} addEventHandler("onPlayerChat", root, function (player) if isTimer(localTime[player]) then cancelEvent() outputChatBox(getPlayerName(source).."has been muted 60 seconds[Flooding]", getRootElement(), 255, 255, 0,true) setPlayerMuted(player, true) setTimer ( removeMute, 60000, 1, player) else localTime[player] = setTimer(function(player) localTime[player] = nil end, 2000, 1, player) end end ) function removeMute ( player ) if ( isElement ( player ) and isPlayerMuted ( player ) ) then setPlayerMuted ( player, false ) outputChatBox (getPlayerName ( player ).." has been unmute.",getRootElement(), 0, 255, 0,true ) end end
-
hmmm no, I'm trying to make is that with the command /ped 1 make the appearance of the Model 240 and the same command but with the number two /ped 2 make up another model.
-
Hello, I'm finishing a script said a ped, which tries to create a ped with a specific ID, but my question is. What is a table or to choose a specific number of skin ? For example: "/ped 1" = 240 or "/ped 2" = 217 pedCreated = function pedCreated(command) local x, y, z = getElementPosition(source) local pedModel = createPed(0, x, y + 5, z) end addCommandHandler("ped", pedCreated)
-
I'm working on a hud containing radar GTA V but when replacing the edge of my radar is the map as a circle, why? so it looks like:
-
explain better, please
-
Hey guys how to add a spawn point for the zombies in specific locations?
-
working on a login/register panel and I have added a 'setCameraMatrix' login but when the camera doesn't return to its original state.
-
I want people to write your text on the bottom bar, click the button to 'send' the written text in the bottom bar is displayed in the memo
-
get the name of the player along with the text
-
I have problems with doing this help panel, When I write something in the text box below and I press the button 'send' does not send the text to the memo, can anyone solve the problem? addEventHandler("onClientResourceStart", resourceRoot, function() window = guiCreateWindow(0.26, 0.13, 0.48, 0.65, "SUPPORT", true) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) guiSetVisible(window, false) edit_writer = guiCreateEdit(0.03, 0.91, 0.75, 0.06, "", true, window) btn_send = guiCreateButton(0.83, 0.91, 0.14, 0.06, "Send", true, window) guiSetProperty(btn_send, "NormalTextColour", "FFAAAAAA") memo_help = guiCreateMemo(0.02, 0.06, 0.95, 0.83, "", true, window) guiMemoSetReadOnly(memo_help, true) end) function toggleWindow() guiSetVisible (window, not guiGetVisible ( window ) ) showCursor(guiGetVisible(window)) end bindKey("F6", "down", toggleWindow) function sendMessage() if isElement(window) then local newText = guiGetText(edit_writer) if newText and string.len(newText) > 0 then local oldText = guiGetText(memo_help) if not oldText then oldText = "" end oldText = oldText .. getPlayerName(localPlayer) .. ": " .. newText .. "\n" guiSetText(memo_help, oldText) guiSetText(edit_writer, "") guiMemoSetCaretIndex(edit_writer, string.len(oldText)) end end end function sendMSG() if (source == btn_send ) then local localP = getPlayerFromName(guiGetText(memo_help)) if localP then sendMessage(localP) end end end addEventHandler("onClientGUIClick", root, sendMSG)
-
but I can still enter the car without equipment
-
I have an error in this script, I want the car in the id '411 'and '402' Whether booked by a team, but when a player who is not a member of the team can lead (server) NameT= "SC Life" vehTeam = {{411,402}} function enterVehicle ( thePlayer, seat, jacked ) if getElementType ( thePlayer ) == "player" then local team = getPlayerTeam ( thePlayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == NameT ) then if ( vehTeam[getElementModel ( source )] ) then outputChatBox("vehicle from: "..NameT, thePlayer, 255, 255, 0, true) else outputChatBox("you can't use this", thePlayer, 255, 255, 0, true) end end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
-
------------------------------------------ -- Author: xXMADEXx -- -- Name: 3D Speakers 2.0 -- -- File: client.lua -- -- Copywrite 2013 ( C ) Braydon Davis -- ------------------------------------------ -- Decompile Security -- sec = {{{{{{},{},{},{}}}}}} -- ------------------------------ -- Variables -- ------------------------------ local subTrackOnSoundDown = 0.1 -- The volume that goes down, when the player clicks "Volume -" local subTrackOnSoundUp = 0.1 -- The volume that goes up, when the player clicks "Volume +" ------------------------------ -- The GUI -- ------------------------------ local rx, ry = guiGetScreenSize ( ) button = { } window = guiCreateWindow( ( rx - 295 ), ( ry / 2 - 253 / 2 ), 293, 253, "Speakers", false) guiWindowSetSizable(window, false) guiSetVisible ( window, false ) CurrentSpeaker = guiCreateLabel(8, 33, 254, 17, "Do you have a currently have a speaker: No", false, window) volume = guiCreateLabel(10, 50, 252, 17, "Current Volume: 100%", false, window) pos = guiCreateLabel(10, 66, 252, 15, "X: 0 | Y: 0 | Z: 0", false, window) guiCreateLabel(11, 81, 251, 15, "URL:", false, window) url = guiCreateEdit(11, 96, 272, 23, "", false, window) --url = guiCreateEdit(11, 96, 272, 23, "http://roscripts.netau.net/sound.mp3", false, window) -- (This link may not work, by the time you get the script) button["place"] = guiCreateButton(9, 129, 274, 20, "Create Speaker", false, window) button["remove"] = guiCreateButton(9, 159, 274, 20, "Destroy Speaker", false, window) button["v-"] = guiCreateButton(9, 189, 128, 20, "Volume -", false, window) button["v+"] = guiCreateButton(155, 189, 128, 20, "Volume +", false, window) button["close"] = guiCreateButton(9, 219, 274, 20, "Exit", false, window) -------------------------- -- My sweet codes -- -------------------------- local isSound = false addEvent ( "onPlayerViewSpeakerManagment", true ) addEventHandler ( "onPlayerViewSpeakerManagment", root, function ( current ) local toState = not guiGetVisible ( window ) guiSetVisible ( window, toState ) showCursor ( toState ) if ( toState == true ) then guiSetInputMode ( "no_binds_when_editing" ) local x, y, z = getElementPosition ( localPlayer ) guiSetText ( pos, "X: "..math.floor ( x ).." | Y: "..math.floor ( y ).." | Z: "..math.floor ( z ) ) if ( current ) then guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true else guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) end end end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == button["close"] ) then guiSetVisible ( window, false ) showCursor ( false ) elseif ( source == button["place"] ) then if ( isURL ( ) ) then triggerServerEvent ( "onPlayerPlaceSpeakerBox", localPlayer, guiGetText ( url ), isPedInVehicle ( localPlayer ) ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true guiSetText ( volume, "Current Volume: 100%" ) else outputChatBox ( "You need to enter a URL.", 255, 0, 0 ) end elseif ( source == button["remove"] ) then triggerServerEvent ( "onPlayerDestroySpeakerBox", localPlayer ) guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) isSound = false guiSetText ( volume, "Current Volume: 100%" ) elseif ( source == button["v-"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) - subTrackOnSoundDown, 2 ) if ( toVol > 0.0 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any lower.", 255, 0, 0 ) end end elseif ( source == button["v+"] ) then if ( isSound ) then local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) + subTrackOnSoundUp, 2 ) if ( toVol < 1.1 ) then outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 ) triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol ) guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" ) else outputChatBox ( "The volume cannot go any higher.", 255, 0, 0 ) end end end end ) speakerSound = { } addEvent ( "onPlayerStartSpeakerBoxSound", true ) addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end local x, y, z = getElementPosition ( who ) speakerSound [ who ] = playSound3D ( url, x, y, z, true ) setSoundVolume ( speakerSound [ who ], 1 ) setSoundMinDistance ( speakerSound [ who ], 13 ) local int = getElementInterior ( who ) setElementInterior ( speakerSound [ who ], int ) setElementDimension ( speakerSound [ who ], getElementDimension ( who ) ) if ( isCar ) then local car = getPedOccupiedVehicle ( who ) attachElements ( speakerSound [ who ], car, 0, 5, 1 ) end end ) addEvent ( "onPlayerDestroySpeakerBox", true ) addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( who ) if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end end ) -------------------------- -- Volume -- -------------------------- addEvent ( "onPlayerChangeSpeakerBoxVolumeC", true ) addEventHandler ( "onPlayerChangeSpeakerBoxVolumeC", root, function ( who, vol ) if ( isElement ( speakerSound [ who ] ) ) then setSoundVolume ( speakerSound [ who ], tonumber ( vol ) ) end end ) function isURL ( ) if ( guiGetText ( url ) ~= "" ) then return true else return false end end function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function maxdistanceFunc(command, param) setSoundMaxDistance( speakerSound [ who ], tonumber(param)) end addCommandHandler("distance", maxdistanceFunc)
-
And if I want to move left or right?
-
because using 'guiGetScreenSize' The position does not change but changing my resolution changes, I want the gui is in its original position for all resolutions. local sx,sy = guiGetScreenSize() function gui() wnd = guiCreateStaticImage(sx / 2.5 - 310, sy / 1.4 - 260, 132, 252, "images/window_sect.png", false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), gui)
-
1.do not talk another languages in english's forum 2. my skype: g.r_754
-
try this: copVehicles = { [523] = true, [598] = true, [596] = true, [597] = true, [599] = true } copTeam = "TEAM1" --- adds this team here function enterVehicle1 ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" ) then local team = getPlayerTeam ( thePlayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == copTeam ) and ( copVehicles[getElementModel ( source )] )) then if ( copVehicles[getElementModel ( source )] ) and ( not getTeamFromName ( "team i use" ) ) then removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("********", thePlayer, 255, 0, 0) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle1 ) medicVehicles = { [416] = true, } medicTeam = "TEAM2" function enterVehicle2 ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" ) then local team = getPlayerTeam ( thePlayer ) local teamName = ( team and getTeamName ( team ) or "" ) if ( teamName == medicTeam ) and ( medicVehicles[getElementModel ( source )] )) then removePedFromVehicle( thePlayer ) outputChatBox("*******", thePlayer, 255, 0, 0) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle2 )
