-
Posts
362 -
Joined
-
Last visited
-
Days Won
3
Everything posted by VenomOG
-
Hey, ( Help in getPlayerTeam ), How to save information individually?
VenomOG replied to kevincouto6's topic in Scripting
zonapvp = createColRectangle ( 5441.9, -1926.4, 119.5, 133 ) event_iniciado = 1 verificarOne = 0 local spawns = { { 5460.70264, -1825.30945, 10.97057 }, { 5454.74805, -1884.13953, 10.29621 }, { 5537.57373, -1887.13306, 11.04092 }, { 5545.14746, -1829.44873, 10.29401 }, { 5501.95557, -1861.66174, 10.29621 } } function start_admin_event (player) if event_iniciado == 1 then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Owner" ) ) then outputDebugString ("Evento Iniciado") event_iniciado = event_iniciado +1 i = 0 pvp_1 = createTeam("PVP-Red [use /pvp]", 255, 0, 0) pvp_2 = createTeam("PVP-Green [use /pvp]", 0, 255, 0) pvp_3 = createTeam("PVP-Blue [use /pvp]", 0, 0, 255) pvp_4 = createTeam("PVP-Yellow [use /pvp]", 255, 255, 0) addCommandHandler ( "pvp", tele ) end else outputChatBox("The event is already activated", player, 255, 0, 0) end end addCommandHandler ( "eventStart", start_admin_event ) function entrar_na_zona( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then --outputChatBox( "Working One" ) redirecionar_team (thePlayer ) end end addEventHandler("onColShapeHit", zonapvp, entrar_na_zona) function sair_da_zona( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then --outputChatBox( "Working Two" ) retirar_team (thePlayer ) end end addEventHandler("onColShapeLeave", zonapvp, sair_da_zona) function tele(player) local teles = math.random ( #spawns ) if ( teles ) then local isTeamPlayer = getPlayerTeam ( player ) if getElementData(player,"SavedTeam") then setElementData(player,"inPVP",true) --outputDebugString (" inPVP ativado ") else --outputDebugString ("Esse playe foi pro pvp mas não tem team") verificarOne = verificarOne +1 end setElementPosition(player, unpack ( spawns [ teles ] )) end end function redirecionar_team (thePlayer) playerTeam = getPlayerTeam(thePlayer) i = i + 1 if i > 4 then i = 1 end if pvp_1 and pvp_2 and pvp_3 and pvp_4 then if i == 1 then setPlayerTeam ( thePlayer, pvp_1 ) end if i == 2 then setPlayerTeam ( thePlayer, pvp_2 ) end if i == 3 then setPlayerTeam ( thePlayer, pvp_3 ) end if i == 4 then setPlayerTeam ( thePlayer, pvp_4 ) end end end function retirar_team (player) if getElementData(player,"SavedTeam") then local t = getElementData ( player, "SavedTeam" ) outputDebugString ("tem timer") setPlayerTeam ( player, getTeamFromName ( t ) ) setElementData(player,"SavedTeam",false) --outputDebugString ("tem time") end end addCommandHandler("stop123", function (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Owner" ) ) then if event_iniciado >= 2 then for k , v in ipairs(getElementsByType("player")) do if getElementData(v,"inPVP") then retirar_team (v) end end for i, team in ipairs(getElementsByType("team")) do destroyElement(team) end removeCommandHandler ( "pvp" ) event_iniciado = 1 else outputChatBox("Unable to stop because it was not started", player, 255, 0, 0) end end end) I made it check if player has SavedTeam data -
He's not explaining the error or what hes trying to do.
-
----- WHERE U SET THE CAR owner if u have a vehicle spawner or what trigger that event with vehicle ID addEvent("onPlayerSpawnVehicle",true) addEventHandler("onPlayerSpawnVehicle",root,function(ID,X,Y,Z,ROT) veh = createVehicle(ID,X,Y,Z,ROT) setElementData(veh, "Owned", "yes") setElementData(veh, "Owner", getAccountName(getPlayerAccount(source))) addEventHandler("onVehicleExplode", veh, function() if getElementData(source, "Owned") == "yes" then outputChatBox("Vehicles: Your vehicle has been has destroyed",getElementData(source,"Owner") ,0,0,0) end end) end)
-
function Test () if getElementData(source, "Owned") then outputChatBox("Vehicles: "..getElementData(source, "vehicleID").." been has destroyed",getElementData(source,"owner") ,0,0,0) end end addEventHandler("onVehicleExplode", getRootElement(), Test) Add a new data to set the Owner , to playerAccount .
-
[QUESTION] Where can I find a vertical dropdown menu?
VenomOG replied to thund3rbird23's topic in Scripting
isOpen = false function render() -----OUTSIDE CODES if Selected == "Menu1" then ----INSIDE CODES elseif Selected == "Menu2" then -----MENU2 INSIDE CODES end end bindKey("F1","down",function() if isOpen == true then isOpen = false showCursor(false) removeEventHandler("onClientRender",root,render) else isOpen = true showCursor(true) Selected = "Menu1" addEventHandler("onClientRender",root,render) end end) Not tested , try it. -
[QUESTION] Where can I find a vertical dropdown menu?
VenomOG replied to thund3rbird23's topic in Scripting
Thats tuff. you have to do some calculations, sadly i dont know i recommend adding a function if Selected == "MenuNUM" DX CODES elseif Selected == "MenuInside" then inside codes end -
Hey, ( Help in getPlayerTeam ), How to save information individually?
VenomOG replied to kevincouto6's topic in Scripting
addEventHandler("O zonapvp = createColRectangle ( 5441.9, -1926.4, 119.5, 133 ) event_iniciado = 1 local spawns = { { 5460.70264, -1825.30945, 10.97057 }, { 5454.74805, -1884.13953, 10.29621 }, { 5537.57373, -1887.13306, 11.04092 }, { 5545.14746, -1829.44873, 10.29401 }, { 5501.95557, -1861.66174, 10.29621 } } function start_admin_event (player) if event_iniciado == 1 then local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Owner" ) ) then outputDebugString ("Evento Iniciado") event_iniciado = event_iniciado +1 i = 0 pvp_1 = createTeam("PVP-Red [use /pvp]", 255, 0, 0) pvp_2 = createTeam("PVP-Green [use /pvp]", 0, 255, 0) pvp_3 = createTeam("PVP-Blue [use /pvp]", 0, 0, 255) pvp_4 = createTeam("PVP-Yellow [use /pvp]", 255, 255, 0) addCommandHandler ( "pvp", tele ) end else outputChatBox("O evento ja esta ativado", player, 255, 0, 0) end end addCommandHandler ( "eventStart", start_admin_event ) function entrar_na_zona( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then outputChatBox( "Working One" ) redirecionar_team (thePlayer ) end end addEventHandler("onColShapeHit", zonapvp, entrar_na_zona) function sair_da_zona( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then outputChatBox( "Working Two" ) retirar_team (thePlayer ) end end addEventHandler("onColShapeLeave", zonapvp, sair_da_zona) function tele(player) local teles = math.random ( #spawns ) if ( teles ) then setElementData(player,"inPVP",true) setElementData ( player, "SavedTeam", getTeamName ( getPlayerTeam ( player ) ) ) setElementPosition(player, unpack ( spawns [ teles ] )) end end function redirecionar_team (thePlayer) playerTeam = getPlayerTeam(thePlayer) i = i + 1 if i > 4 then i = 1 end if pvp_1 and pvp_2 and pvp_3 and pvp_4 then if i == 1 then setPlayerTeam ( thePlayer, pvp_1 ) end if i == 2 then setPlayerTeam ( thePlayer, pvp_2 ) end if i == 3 then setPlayerTeam ( thePlayer, pvp_3 ) end if i == 4 then setPlayerTeam ( thePlayer, pvp_4 ) end end end function retirar_team (player) local t = getElementData ( player, 'SavedTeam' ) setPlayerTeam ( player, getTeamFromName ( t ) ) setElementData(player,"SavedTeam",false) end addCommandHandler("stop123", function (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Owner" ) ) then if event_iniciado >= 2 then for k , v in ipairs(getElementsByType("player")) do if getElementData(v,"inPVP") then retirar_team (v) end end for i, team in ipairs(getElementsByType('team') do destroyElement(team) end removeCommandHandler ( "pvp" ) event_iniciado = 1 else outputChatBox("Não possivel parar, porque não foi iniciado", player, 255, 0, 0) end end end) Try this *UPDATED* -
So im working on a ucp system and i added settings part, when i click settings section it shows but after i close and open, its gone :C my Code elseif o == "Settingss" then GUIEditord.grid[1] = guiCreateScrollPane(950, 350, 288, 278, false) for k,v in pairs (stngs) do l3 = guiCreateLabel(200, 18, 500, 630, "Settings", false, GUIEditord.grid[1]) guiSetFont(l3, "default-bold-small") nextSettingY = nextSettingY + 18 for _,sin in pairs (v) do l4 = guiCreateCheckBox(18, nextSettingY3+13, 298, 16, sin[1], false, false,l3) addEventHandler("onClientGUIClick", l4, sin[2]) guiCheckBoxSetSelected(l4, sin[3]()) nextSettingY3 = nextSettingY3 + 25 end end
-
Contact me your offer. Or my discord : Watchout#6666 i can make it DX or GUI , your choice, cheap.
-
Yes true, i didnt see sorry
-
local health1 = getElementHealth(getPlayerFromName(player)) guiSetText(label1, "HP: "..math.round(health1,2).. " %") Try this
-
So how do i define the element can i do it like ped = createPed(aa,aaa,aaaa,aaaa,aaaa) setElementData(ped,"slothbot",true) addEvent("onBotWasted",true) addEventHandler("onBotWasted",ped,function(attacker,weapon,part) if attacker then givePlayerMoney(attacker,444) end end) This is just example, can i do it like this?
-
When i spawn the bots they turn on each other how to fix that? and set them only attacking law enforcers and also how to make if the bot died by someone that person gets $ My code so far local botpos = { {-2513.33, -625.5, 132.83,275}, {-2539.88, -598.1, 132.71,269}, {-2523.29, -597.1, 132.71,269}, {-2471.75, -626.18, 132.7,261}, {-2467.76, -611.36, 132.65,275}, {-2488.54, -609.61, 132.63,178}, {-2488.77, -623.56, 132.65,357} } for k , v in ipairs(botpos) do exports["(AAA)Slothbots"]:spawnBot(v[1],v[2],v[3],v[4],124,0,0,"Gangster",31,"guarding",source) end
-
New forums released http://saegrpg.com/ Take a look
-
What does inspect to, thanks tho read my second reply does it do that? ------------------------------ -- Authors: IIYAMA and Kenix -- ------------------------------ local addEventHandler = addEventHandler; local removeEventHandler = removeEventHandler; local table_remove = table.remove; local unpack = unpack; local len = table.getn; local root = root; local renderEvents = { "onClientRender", "onClientPreRender", "onClientHUDRender" } local allTargetFunctions = {} -- All attached functions will be stored in this table. local acceptedRenderEventTypes = {} -- Is type in use? See: renderEvents. local renderEventTypeStatus = {} -- Is the event in use? (so it doesn't have to be attached again) do -- prepare the data for i=1, len( renderEvents ) do local event = renderEvents[i] allTargetFunctions[event] = {} acceptedRenderEventTypes[event] = true renderEventTypeStatus[event] = false end end -- render all events here local processTargetFunction = function ( timeSlice ) local targetFunctions = allTargetFunctions[ eventName ] local i = 1 local itemCount = len(targetFunctions) repeat if targetFunctions[ i ] == true then -- remove = true table_remove( targetFunctions, i ) itemCount = itemCount - 1 else local targetFunctionData = targetFunctions[i] local arguments = targetFunctionData[2] if not arguments then targetFunctionData[ 1 ]( timeSlice ) else if timeSlice then targetFunctionData[ 1 ]( timeSlice, unpack( arguments ) ) else targetFunctionData[ 1 ]( unpack( arguments ) ) end end i = i + 1 end until i > itemCount end -- check if a function is already attached function isRenderEventAdded (theFunction, event) if not event or not acceptedRenderEventTypes[event] then event = "onClientRender" end local targetFunctions = allTargetFunctions[event] for i = 1, len( targetFunctions ) do if targetFunctions[i] and targetFunctions[i] ~= true and targetFunctions[i][1] == theFunction then return true end end return false end local isRenderEventAdded = isRenderEventAdded -- add render event, default type is onClientRender function addRenderEvent(theFunction, event, ...) if not event or not acceptedRenderEventTypes[event] then event = "onClientRender" end if not isRenderEventAdded(theFunction) then local targetFunctions = allTargetFunctions[event] -- Don't pass an arguments if it not needed. local aArgs = { ... }; local mArgs = len( aArgs ) > 0 and aArgs or nil; targetFunctions[ len( targetFunctions ) + 1 ] = { theFunction, mArgs } -- attach an event if not renderEventTypeStatus[event] then addEventHandler (event, root, processTargetFunction, false, "high") renderEventTypeStatus[event] = true end return true end return false end -- remove a render event function removeRenderEvent(theFunction, event) if not event or not acceptedRenderEventTypes[event] then event = "onClientRender" end local targetFunctions = allTargetFunctions[event] for i = 1, len( targetFunctions ) do if targetFunctions[i] and targetFunctions[i] ~= true and targetFunctions[i][1] == theFunction then targetFunctions[i] = true -- true = remove if len( targetFunctions ) == 0 then if renderEventTypeStatus[event] then removeEventHandler (event, root, processTargetFunction) renderEventTypeStatus[event] = false end end return true end end return false end ----------------- function dxDrawRelativeText( text,posX,posY,right,bottom,color,scale,mixed_font,alignX,alignY,clip,wordBreak,postGUI ) local resolutionX = 1366 local resolutionY = 768 local sWidth,sHeight = guiGetScreenSize( ) return dxDrawText( tostring( text ), ( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( right/resolutionX )*sWidth, ( bottom/resolutionY)*sHeight, color, ( sWidth/resolutionX )*scale, mixed_font, alignX, alignY, clip, wordBreak, postGUI ) end function dxDrawRelativeRectangle( posX, posY, width, height,color,postGUI ) local resolutionX = 1366 local resolutionY = 768 local sWidth,sHeight = guiGetScreenSize( ) return dxDrawRectangle( ( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( width/resolutionX )*sWidth, ( height/resolutionY )*sHeight, color, postGUI ) end function dxDrawRelativeImage( posX, posY, width, height,link,r1,r2,r3,color,postGUI ) local resolutionX = 1366 local resolutionY = 768 local sWidth,sHeight = guiGetScreenSize( ) return dxDrawImage( ( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( width/resolutionX )*sWidth, ( height/resolutionY )*sHeight, ""..link, r1, r2, r3, color, postGUI ) end function dxDrawRelativeLine( posX, posY, width, height,color, size, postGUI ) local resolutionX = 1366 local resolutionY = 768 local sWidth,sHeight = guiGetScreenSize( ) return dxDrawLine( ( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( width/resolutionX )*sWidth, ( height/resolutionY )*sHeight, color, size, postGUI ) end function drawkeys(keys,key) local z1 = 0 for keyName, state in pairs(keys) do z1 = z1+90 dxDrawRelativeText(keyName, 0+z1, 455, 109, 469, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end dxDrawRelativeLine(86 - 1, 411 - 1, 86 - 1, 450, tocolor(254, 254, 254, 132), 1, false) dxDrawRelativeLine(303, 411 - 1, 86 - 1, 411 - 1, tocolor(254, 254, 254, 132), 1, false) dxDrawRelativeLine(86 - 1, 450, 303, 450, tocolor(254, 254, 254, 132), 1, false) dxDrawRelativeLine(303, 450, 303, 411 - 1, tocolor(254, 254, 254, 132), 1, false) dxDrawRelativeRectangle(86, 411, 217, 39, tocolor(0, 0, 0, 132), false) dxDrawRelativeImage(90, 411, 45, 39, ":SAEGTradeSystem/images/dmt.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRelativeImage(145, 411, 45, 39, ":SAEGTradeSystem/images/pcp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRelativeImage(200, 411, 45, 39, ":SAEGTradeSystem/images/cocaine.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRelativeImage(252, 411, 45, 39, ":SAEGTradeSystem/images/morphine.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent("triggerKeys",true) addEventHandler("triggerKeys",root,function() controlName = "use" local keys = getBoundKeys ( controlName ) -- get the keys bound to this control if not keys then -- make sure the control name is valid and any keys are bound to it removeEventHandler("onClientRender",root,drawkeys) return end addRenderEvent(drawkeys,"onClientRender",keys,keys) end) I used your functions - they worked for rendering but its showing all keys binded to "use" command i just wanna find ["Tires"]["Mask"]["Gas"]["Title"]
-
Hey im trying to get keys that are binded to a function basically im gonna get bounded keys from a function lets say a test function ("use") im trying to get those bounded keys and use them in a client side i found a function getBoundKeys ( ) i was wondering if i can do it like keys = {} local zz = 0 local keys = getBoundKeys ( "use" ) -- get the keys bound to this control if not keys then -- make sure the control name is valid and any keys are bound to it removeEventHandler("onClientRender",root,SOMETHING) return end if keys then addEventHandler("onClientRender",root,function() for keyName, state in pairs(keys) do zz = zz+50 dxDrawText(keyName, 1083, 190+zz, 1149, 206, tocolor(255, 255, 255, 255), 0.9, "default-bold", "center", "top", false, false, true, false, false) end end end) end something like this, its just something off the bat of my head or example but basically i will draw couple texts and its like diffrent variables in a row
-
Been there , done that, with a fablet
-
Another day We are waiting you guys
-
Hey! We are still waiting on some new players to host some events for prizes , visit us
-
Today
-
Server opened! IP: mtasa://46.105.250.205:26014 Discord: https://discord.gg/kCKy4KV Updates Visit and take a look!
-
Um sorry about that, we were gonna open it that day but my pc got a .peta virus, and i returned today so we are back to working again sorry guys join our discord to be updated!