-
Posts
395 -
Joined
-
Last visited
Everything posted by HUNGRY:3
-
Weird it's not working ;(
-
hello i made a script that cancel the player when he shoot but it is not working or hit some one when he's on NODM Data addEventHandler( "onWeaponFire", root, function () if getElementData(source,"NODM") == true then cancelEvent() end end)
-
did i do some thing wrong? client: function addRunPlayer(table) GUIEditor.gridlist[8] = guiCreateGridList(9, 104, 589, 273, false, GUIEditor.window[8]) column = guiGridListAddColumn( GUIEditor.gridlist[8], "Players", 0.85 ) if column then for id, player in ipairs(table) do row = guiGridListAddRow ( GUIEditor.gridlist[8] ) guiGridListSetItemText ( GUIEditor.gridlist[8], row, column, getPlayerName ( player ), false, false ) end end end addEvent( "RUN3", true ) addEventHandler( "RUN3", root, addRunPlayer ) server: function getPlayers() local playersInRun = {} for index, players in ipairs (getElementsByType("player")) do if getElementData(players, "RUN") then table.insert(playersInRun, players) end end return playersInRun end function hijackerDC () if getElementData(source, "RUN") then table.removevalue( readyPlayerList, source ) end end addEventHandler("onPlayerQuit",root, hijackerDC) function table.removevalue(t, val) for i,v in ipairs(t) do if v == val then table.remove(t, i) return i end end return false end triggerClientEvent (source,"RUN3",source)
-
for i,v in ipairs(getElementsByType("player")) if getElementData(v,"RUN") then setTimer( function( ) guiSetText(GUIEditor.label[8], 'ONLINE PLAYERS IN RUN: '.. #getElementsByType('player') ) end, 100, 0 ) end
-
for i,v in ipairs(getElementsByType("player")) if getElementData(v,"RUN") then --Here is your code end end not working
-
i did it but it shows all the players how to make it for the players who has the data of "RUN" code: setTimer( function( ) guiSetText(GUIEditor.label[8], 'ONLINE PLAYERS IN RUN: '.. #getElementsByType('player') ) end, 100, 0 )
-
hello every body i'm trying to make a window.... with 1 button and a grid list in the grid list i want it to show online players nicks that has an elementData getElementData(source,"RUN") == true can some body tell me how to do it?
-
thanks the timer didn't work but i fixed it any way thanks man!
-
your script didn't work but i fixed it there's now another problem when i change my nick it stays for ever i tryed settimer but didn't work here's the code : local nick addEventHandler("onClientPlayerJoin", root, function() addEventHandler("onClientRender", root, function () dxDrawText("* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." has joined the game ", 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end) end) addEventHandler("onClientPlayerChangeNick", root, function(old, new) old = old:gsub("#%x%x%x%x%x%x","") new = new:gsub("#%x%x%x%x%x%x","") if old ~= new then addEventHandler("onClientRender", root , function ( ) nick = dxDrawText("* "..old.." is now known as "..new, 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end) end setTimer(nick,500,1) addEventHandler("onClientPlayerQuit", root, function(reason) addEventHandler("onClientRender", root, function ( ) dxDrawText("* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." #006400 has left the game [#FFFFFF" .. reason .. "#006400]", 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end) end) end)
-
hello every body so..... i made join quit with dxdrawtext but when i change my nick or some one join it just show for 1 sec or i should say half of the second i know i must use "onClientRender" but idk where to put it addEventHandler("onClientPlayerJoin", root, function() dxDrawText("* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."has joined the game", 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end) addEventHandler("onClientPlayerChangeNick", root, function(old, new) old = old:gsub("#%x%x%x%x%x%x","") new = new:gsub("#%x%x%x%x%x%x","") if old ~= new then dxDrawText("* "..old.."is now known as"..new, 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end) addEventHandler("onClientPlayerQuit", root, function(reason) dxDrawText("*"..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."#006400 has left the game [#FFFFFF" .. reason .. "#006400]", 38, 507, 230, 522, tocolor(255, 255, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) dxDrawImage(0, 497, 28, 25, "join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end)
-
it's 20 D:?
-
looks nice great job
-
it's not that hard... here you go.. SERVER SIDE local marker = createMarker ( 476.0654296875, -1765.6552734375, 14.117799758911, "cylinder", 1.5, 255, 255, 0, 170 ) function openwindow(hitPlayer) triggerClientEvent (hitPlayer,"showwin",getRootElement(),hitPlayer) end addEventHandler("onMarkerHit",marker,openwindow) createTeam("Police", 255, 0, 0) function policeman() local policeteam = getTeamFromName("Police") setPlayerTeam ( source, policeteam ) outputChatBox("You're Now A Police Man!",source,255,0,0) end addEvent( "setTeamNow", true ) addEventHandler( "setTeamNow", root, policeman ) CLIENT SIDE GUIEditor = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(589, 389, 520, 321, "Want To Be A Police Man?", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.button[1] = guiCreateButton(9, 32, 501, 107, "ACCEPT", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFF0000") GUIEditor.button[2] = guiCreateButton(9, 204, 501, 107, "CLOSE", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") end ) function showwindow() guiSetVisible(GUIEditor.window[1],true) showCursor(true) end addEvent("showwin",true) addEventHandler("showwin", getRootElement(), showwindow) function closewindow() if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end addEventHandler("onClientGUIClick", root, closewindow) function setpolice() if source == GUIEditor.button[1] then triggerServerEvent ("setTeamNow",localPlayer) end end addEventHandler("onClientGUIClick", root, setpolice) tested and it works 100%
-
oi guys? what happend to community.multitheftauto.com ? it's not working with me is it only me or?
-
when the weapon bullets is 0 ....it disappear...so he want to keep the weapon with the player when the weapon bullets is 0
-
What does debugscript say?
-
function redirectPlayer(thePlayer, commandName,targetPlayer, serverIP, serverPort) local playername = getPlayerName(thePlayer) if playername and targetPlayer and serverIP and serverPort then local targetPlayer = getPlayerFromNick(targetPlayer) redirectPlayer(targetPlayer,serverIP,tonumber(serverPort)) else outputChatBox("Error",source,255,0,0,true) end end addCommandHandler("rd",redirectPlayer) function findPlayerByName(name) local player = getPlayerFromName(name) if player then return player end for i, player in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(player):lower(),"#%x%x%x%x%x%x", ""), name:lower(), 1, true) then return player end end return false end not tested
-
what ever
-
are u trying to make a sound when player click gui button? if so function sound() if source == spawn then playSound("sounds/Enter.mp3") end end addEventHandler("onClientGUIClick", root, sound)
-
function baseblip(player) local bliper = getElementData(player,"bliper") or 0 if bliper == true then blip = createBlip ( 1972.5458984375, -1113.5166015625, 25.628751754761, 59,2,0,0,0, 255,0, 99999) outputChatBox ("blip added!", player,0,0,255) setElementData(player,"bliper",false) else if not getElementData(player,"bliper") == true then destroyElement(blip) outputChatBox ("blip removed!", player,0,0,255) setElementData(player,"bliper",true) end end end addCommandHandler("baseblips",baseblip) it get hide/show in the same command should work
-
not working
-
yeah i removed it i did setElementCollisionsEnabled(base, true) but didn't work..
-
not working but have a look at my script function base() if source == GUIEditor.button[1] then local x, y, z = getElementPosition(localPlayer) base = createObject(8240, x , y +5 , z +5 ) setObjectScale(base, 0.5) baseCol = createColSphere(x , y +5, z +5) attachElements(baseCol, base, 0, 0, 0) end end addEventHandler("onClientGUIClick", root, base)