-
Posts
34 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mischief-1
-
please close this thread. thanks!
-
I was able to fix this error, I kinda had to rewrite it.
-
I managed to solve this error, I'm not sure if I'm doing it correctly. addCommandHandler("globalchat", function(player, _, ...) if (configVar.globalchat) then local string globalAccount = table.concat({...}) if exports.adblock:isAdvertisement(globalAccount) then outputChatBox("#880808[Warning!] #D3D3D3Advertising is not allowed, further doing so can result in getting banned!.", source, 211, 211, 211,true) return; end if isPlayerMuted(player) then outputChatBox(getLanguageTextServer("clientinfotext43",player), player, 136,8,8); return; end if (getElementData(player,"antichat")) then outputChatBox(getLanguageTextServer("clientinfotext41",player), player, 136,8,8); return; else setElementData(player,"antichat",true) setTimer(setElementData, 1000, 1, player, "antichat", false); end for _,v in ipairs(getElementsByType("player")) do outputChatBox("#880808[Global] #D3D3D3"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#D3D3D3: "..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); end end end);
- 4 replies
-
- ad blocker
- anti-ad
-
(and 3 more)
Tagged with:
-
Hi my apologies for bumping this old threat, however I am having problem using the export. addCommandHandler("globalchat", function(player, _, ...) if (configVar.globalchat) then if exports.adblock:isAdvertisement(message) then outputChatBox("#880808[Warning!] #D3D3D3Advertising is not allowed, further doing so can result in getting banned!.", source, 211, 211, 211,true) return; end if isPlayerMuted(player) then outputChatBox(getLanguageTextServer("clientinfotext43",player), player, 136,8,8); return; end if (getElementData(player,"antichat")) then outputChatBox(getLanguageTextServer("clientinfotext41",player), player, 136,8,8); return; else setElementData(player,"antichat",true) setTimer(setElementData, 1000, 1, player, "antichat", false); end for _,v in ipairs(getElementsByType("player")) do outputChatBox("#880808[Global] #D3D3D3"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#D3D3D3: "..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); end end end);
- 4 replies
-
- ad blocker
- anti-ad
-
(and 3 more)
Tagged with:
-
No problem, grad to help you can request to close this thread to admins if nothing else is needed
-
Desculpe, não entendi, você pode me dar um exemplo.
-
Please disregard the post above.. This is a working code ----server addCommandHandler("adminchat", function(player, _, ...) local account = getAccountName(getPlayerAccount(player)) --get the player account for _,v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user." .. account, aclGetGroup("Staff")) then --- this section you can customize which ACL role they are. outputChatBox("#7D6608[Admin]#9A7D0A"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#7D6608: #FFFFFF"..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); --- thisplay chat you can customize as well. else outputChatBox("You don't have enough access to use this chat!") end end end ) ---client bindKey("h", "down", "chatbox", "adminchat"); Please hit like on 2 of my posts if these helped you
-
It should be possible, just a concept, not sure it works with this code, but you can modify the rest. --- server addCommandHandler("adminchat", function(player, _, ...) for _,v in ipairs(getElementsByType("player")) do if isObjectInACLGroup("user."..account,aclGetGroup("Staff")) then --- uses ACL to determine who is able use. if (getElementData(v, "adminchat") == getElementData(player, "adminchat")) then outputChatBox("#7D6608[Admin]#9A7D0A"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."#7D6608: #FFFFFF"..table.concat({...}, " "):gsub("#%x%x%x%x%x%x", ""), v, 255, 255, 255, true); end end end end); --- client bindKey("u", "down", "chatbox", "adminchat");
-
Seemed like I added extra lines that were not useful.. Here is the revised code.
-
Hi everyone, I would like to share this revived script for removing hex in players' nickname. PS: I do not own this, credits go to where credit is due. I modified it and added conditions to make sure that no hex will go thru. as currently the script available in community does not work for people who uses two hexes in their name example /nick #FFA500#FFA500Test as it will only remove one. Current problem I'm trying to solve is that when changing nickname, it displays twice because the user changes the nickname twice so want to remove that one. See pic as reference. Thanks! Feel free to comment as well to help improve the code https://imgur.com/a/6MwJmst
-
I hate to bump this old script, but I've been trying to modify it to my liking, I would love to share it as well to the community if anyone needs it, but I need a little help. I've been having errors when giving items to someone. If you can still respond to this, can you help me? https://imgur.com/a/6WZ3KjU server function giveEvent(selectedPlayer,item,quantity) setElementData(selectedPlayer,item,getElementData(selectedPlayer,item)+quantity) outputChatBox(prefix.." Admin "..string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." gave you "..quantity.." "..item,selectedPlayer,0,0,0,true) outputChatBox(prefix.." You gave "..quantity.." "..item.." to "..string.gsub(getPlayerName(selectedPlayer), "#%x%x%x%x%x%x", ""),source,0,0,0,true) end addEvent("giveEvent",true) addEventHandler("giveEvent",root,giveEvent) client function give() if (guiGridListGetSelectedItem(giveWindowGridlist) ~= -1) then local item = guiGridListGetItemText(giveWindowGridlist,guiGridListGetSelectedItem(giveWindowGridlist)) local quantity = guiGetText(giveWindowEditboxQuant) local selectedPlayer = getPlayerFromName(guiGridListGetItemText(gridlistPlayers1,item,1)) if selectedPlayer then triggerServerEvent("giveEvent",localPlayer,selectedPlayer,item,quantity) end end end
-
Como faço para que ao usar visão noturna ou infravermelho, a distância e a luz voltem ao normal e se estiver desligada, volte a seguir este código? Tentei fazer a condição, mas quando desligo o infravermelho ou a visão noturna a distância só volta ao normal depois de 1 minuto.
-
Please close this thread thanks!
-
I see, thanks how do I make the gui that when i press the key again it closes? addEvent("playerOnClick", true) addEventHandler("playerOnClick", root, function() guiGridListClear ( w.gridList.main ) for i,veh in ipairs(getElementsByType("vehicle")) do if veh ~= vehicle then local row = guiGridListAddRow ( w.gridList.main ) local x,y,z = getElementPosition(veh) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column1, getVehicleName ( veh ), false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column2, x, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column3, y, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column4, z, false, false ) end end guiSetVisible(w.main, true) showCursor(true) end ) function hasPermission(key,keyState) if getElementData(localPlayer, "logedin") then triggerServerEvent("hasPermissionEvent",localPlayer,key,keyState) end end bindKey("p", "down", hasPermission) Edit : you can disregard these, I made if else statement and created to false. function playerOnClick(key,keyState) if (keyState == "down") then if (guiGetVisible(w.main) == false) then guiGridListClear ( w.gridList.main ) for i,veh in ipairs(getElementsByType("vehicle")) do if veh ~= vehicle then local row = guiGridListAddRow ( w.gridList.main ) local x,y,z = getElementPosition(veh) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column1, getVehicleName ( veh ), false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column2, x, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column3, y, false, false ) guiGridListSetItemText ( w.gridList.main, row, w.gridList.column4, z, false, false ) end end guiSetVisible(w.main, true) showCursor(true) else guiSetVisible(w.main, false) showCursor(false) end end end addEvent("playerOnClick",true) addEventHandler("playerOnClick",root,playerOnClick) but of course, If you can recommend a better way than what I did please feel free to share your opinion I would very much appreciate it.
-
Hello everyone! How do I disable horizontal gridlist scroll? I want to have it only scrolling vetically. GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 544) / 2, (screenH - 401) / 2, 544, 401, "Vehicle & Tend Finder", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.77) GUIEditor.button[1] = guiCreateButton(176, 350, 77, 37, "Locate", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(263, 350, 77, 37, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.gridlist[1] = guiCreateGridList(538, 274, 524, 309, false) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "X", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "Y", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "Z", 0.2)
-
please close thread as resolved. Thanks!
-
@gustavorn por favor veja a imagem: Obrigado pela resposta! Essas linhas mudam, mas o jogador que não está no grupo ainda se vê. -- if gangname == "" then return end -- Verificar se o jogador pertence a um grupo if gangname == "none" then return end Edit: acho que consertei --defina verdadeiro ou falso if gangname == false then return end Por favor feche este tópico
-
--GPS playerBlibs = {} amouunt = 0 function updateGPS () amouunt = 0 local gangname = getElementData(getLocalPlayer(),"gang") for i, blip in ipairs(playerBlibs) do if isElement(blip) then destroyElement(blip) end end if getElementData(getLocalPlayer(),"gang") == "none" then return end playerBlibs = {} for i, player in ipairs(getElementsByType("player")) do if gangname == getElementData(player,"gang") and player ~= localPlayer then amouunt = amouunt+1 playerBlibs[amouunt] = createBlipAttachedTo(player,2,2) setBlipVisibleDistance(playerBlibs[amouunt],1000) end end end setTimer(updateGPS,5000,0) Olá, gostaria de perguntar. Quando um jogador inicialmente não tem time ele não se mostra no blip, mas quando criamos um grupo e ambos saem do grupo então não são time, eles ainda se mostram no mesmo blip. a mesma coisa acontece se eles estiverem em grupos diferentes e saírem do time.
-
Agradeço sua resposta, também consegui descobrir isso. o que fiz foi chamar "getPlayerMoney (source)" pelo resto do tempo, em vez de criar uma variável local. este tópico pode ser fechado agora foi assim que eu fiz, trecho de exemplo if (getPlayerMoney(source) >= price) then guiSetText(shop_gui.label[4],"You successfully bought "..item..".") guiLabelSetColor (shop_gui.label[4],0,149,14,255) triggerServerEvent("DayZPH:onClientSuccessBuysItem",localPlayer,target,itemdata,getPlayerMoney(source),amount,price) else guiSetText(shop_gui.label[4],"You don't have enough money (PHP) to buy utilities")
-
addEventHandler("onClientElementDataChange",root,function(data) if getElementData(localPlayer, "logedin") then if (string.find(data,getPlayerMoney(source))) then guiSetText(shop_gui.label[1], " Pesos (PHP): "..getPlayerMoney(source)) end end end) Update: this is the code, may I know what I did wrong?
-
here is a snippet when trying to buy https://ibb.co/fv5JpbZ edit: I was able to have it work by removing local variable currency_item on clientside and directly calling the getPlayerMoney(source) I am currently trying to fix the gui right now as it currently does not display the money. will update once finished
-
addEventHandler("onClientResourceStart", resourceRoot, function() end ) addEventHandler("onClientRender", root, function() local cash = getPlayerMoney( getLocalPlayer() ) dxDrawText("PHP:", 625, 104, 688, 128, tocolor(35, 98, 36, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText(""..cash, 704,104,796,123, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) end )
-
Olá, estou com um problema com um script que atualmente aceita elementdata como moeda. local currency_item = "zombieskilled"; if (guiGridListGetSelectedItem(shop_gui.gridlist[2] ) == -1) then guiSetText(shop_gui.label[4],"Please select an item") guiLabelSetColor (shop_gui.label[4],255,0,0) else if (shop_marker_type == "supply") then local target = localPlayer; local item = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local amount,price,itemdata = unpack(guiGridListGetItemData(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),2)) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer, currency_item) >= price) then guiSetText(shop_gui.label[4],"You successfully bought "..item..".") guiLabelSetColor (shop_gui.label[4],0,149,14,255) triggerServerEvent("DayZPH:onClientSuccessBuysItem",localPlayer,target,itemdata,currency_item,amount,price) else guiSetText(shop_gui.label[4],"You don't have enough money (PHP) to buy utilities") end elseif (shop_marker_type == "vehicle") then local target = localPlayer; local vehicleName = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local id,engine,rotor,tires,tankparts,scrap,slots,fuel,price = unpack(guiGridListGetItemData(shop_gui.gridlist[2],guiGridListGetSelectedItem(shop_gui.gridlist[2]),1)) local x,y,z,rx,ry,rz = unpack(vehicle_spawn_position) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer,currency_item) >= price) then for i,v in ipairs(getElementsWithinColShape(vehicle_spawn_position_col[shop_marker],"vehicle")) do guiSetText(shop_gui.label[4],"Vehicle spawn area is taken, clear it before buying vehicle.") return end guiSetVisible(shop_gui.window[1],false) showCursor(false) outputChatBox("You successfully bought "..vehicleName..".",0,255,0) triggerServerEvent("DayZPH:onClientSuccessBuysVehicle",localPlayer,target,currency_item,price,x,y,z,rx,ry,rz,id,engine,rotor,tires,tankparts,scrap,slots,fuel) else guiSetText(shop_gui.label[4], "You don't have enough money (PHP) to buy a car") end end end server side function onClientSuccessBuysItem(target,item,currency,amount,price) setElementData(target,item,getElementData(target,item)+amount) setElementData(target,currency,getElementData(target,currency)-price) end addEvent("DayZPH:onClientSuccessBuysItem",true) addEventHandler("DayZPH:onClientSuccessBuysItem",getRootElement(),onClientSuccessBuysItem) addEventHandler("onPlayerLogin",root,function() triggerClientEvent(source,"load_shop",source); end); Eu tentei mudar a variável para currency_item = getPlayerMoney(source); mas não vejo isso funcionando. alguma coisa que estou perdendo? Por favor me ajude veja o código completo client server
-
Hello, thanks for the response, I tried doing this code takePlayerMoney(target, price) on server side earlier. but the shop stops working. This is the full code I have; can you take a look please? client side clientside - Pastebin.com server side server side - shop system - Pastebin.com
-
Hi, I have a problem with a script currently it accepts an elementdata as its currency. local currency_item = "zombieskilled"; if (guiGridListGetSelectedItem(shop_gui.gridlist[2] ) == -1) then guiSetText(shop_gui.label[4],"Please select an item") guiLabelSetColor (shop_gui.label[4],255,0,0) else if (shop_marker_type == "supply") then local target = localPlayer; local item = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local amount,price,itemdata = unpack(guiGridListGetItemData(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),2)) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer, currency_item) >= price) then guiSetText(shop_gui.label[4],"You successfully bought "..item..".") guiLabelSetColor (shop_gui.label[4],0,149,14,255) triggerServerEvent("DayZPH:onClientSuccessBuysItem",localPlayer,target,itemdata,currency_item,amount,price) else guiSetText(shop_gui.label[4],"You don't have enough money (PHP) to buy utilities") end elseif (shop_marker_type == "vehicle") then local target = localPlayer; local vehicleName = guiGridListGetItemText(shop_gui.gridlist[2], guiGridListGetSelectedItem(shop_gui.gridlist[2]),1) local id,engine,rotor,tires,tankparts,scrap,slots,fuel,price = unpack(guiGridListGetItemData(shop_gui.gridlist[2],guiGridListGetSelectedItem(shop_gui.gridlist[2]),1)) local x,y,z,rx,ry,rz = unpack(vehicle_spawn_position) guiLabelSetColor(shop_gui.label[4],255,0,0) if (getElementData(localPlayer,currency_item) >= price) then for i,v in ipairs(getElementsWithinColShape(vehicle_spawn_position_col[shop_marker],"vehicle")) do guiSetText(shop_gui.label[4],"Vehicle spawn area is taken, clear it before buying vehicle.") return end guiSetVisible(shop_gui.window[1],false) showCursor(false) outputChatBox("You successfully bought "..vehicleName..".",0,255,0) triggerServerEvent("DayZPH:onClientSuccessBuysVehicle",localPlayer,target,currency_item,price,x,y,z,rx,ry,rz,id,engine,rotor,tires,tankparts,scrap,slots,fuel) else guiSetText(shop_gui.label[4], "You don't have enough money (PHP) to buy a car") end end end server side function onClientSuccessBuysItem(target,item,currency,amount,price) setElementData(target,item,getElementData(target,item)+amount) setElementData(target,currency,getElementData(target,currency)-price) end addEvent("DayZPH:onClientSuccessBuysItem",true) addEventHandler("DayZPH:onClientSuccessBuysItem",getRootElement(),onClientSuccessBuysItem) addEventHandler("onPlayerLogin",root,function() triggerClientEvent(source,"load_shop",source); end); I tried changing the variable to currency_item = getPlayerMoney(source); but I don't see it working. anything I'm missing? Please assist me