0 Üye ve 1 Ziyaretçi konuyu incelemekte.
function onAdmins ( thePlayer )local cuenta = getAccountName( getPlayerAccount(thePlayer) ) if isObjectInACLGroup("user."..cuenta, aclGetGroup("Admin")) then triggerClientEvent ( "Abrir", thePlayer) else--outputChatBox("", thePlayer, 255, 0, 0, true) endendaddCommandHandler("giveaway", onAdmins)function Enviar (paraMiktari, name) if not tonumber(paraMiktari) then outputChatBox("Wrong usage!", oyuncu, 255, 0, 0,true) return end oyuncuCek = {} for _,g in ipairs(getElementsByType("player")) do table.insert(oyuncuCek, getPlayerName(g)) end randomCek = math.random(1, #oyuncuCek) kazanan = oyuncuCek[randomCek] givePlayerMoney(getPlayerFromName(kazanan), tonumber(paraMiktari)) outputChatBox("[Giveaway] #990033"..getPlayerName(oyuncu).."#ffffff is started the giveaway event for #00ff00$"..paraMiktari.."" , root, 255, 125, 0,true) outputChatBox("[Giveaway] #990033Winner is: #ffffff"..kazanan.."" , root, 255, 125, 0,true) oyuncuCek = {}endaddEvent("SendMoney1", true)addEventHandler("SendMoney1", getRootElement(), Enviar)
GUIEditor = { button = {}, staticimage = {}, edit = {}, label = {}} function giveaway ()local screenW, screenH = guiGetScreenSize() background = guiCreateStaticImage((screenW - 879) / 2, (screenH - 576) / 2, 879, 576, ":test/ozy/bg.png", false) guiSetAlpha(background, 0.87) close = guiCreateButton(653, 392, 58, 24, "Close", false, background) blur = guiCreateStaticImage(-4, 141, 884, 63, ":test/ozy/blur.png", false, background) baslik = guiCreateLabel(247, 158, 401, 27, "GIVEAWAY PANEL", false, background) guiLabelSetColor(baslik, 153, 0, 51) guiLabelSetHorizontalAlign(baslik, "center", false) guiLabelSetVerticalAlign(baslik, "center") --text = guiCreateLabel(328, 258, 169, 27, "Giveaway money amount:", false, background) guiLabelSetVerticalAlign(text, "center") start = guiCreateButton(362, 296, 140, 30, "Start Event", false, background) button = guiCreateEdit(470, 258, 199, 25, "Enter an Amount..", false, background) showCursor(true) addEventHandler("onClientGUIClick", close, kapat, false) endfunction Open () guiSetVisible(GUI, true) showCursor(true)endaddEvent("Abrir", true)addEventHandler("Abrir", getLocalPlayer(), Open)function kapat () guiSetVisible(GUI, false) showCursor(false)endaddEventHandler("onClientGUIClick", close, kapat, false)function sendm () name = getPlayerName(getLocalPlayer()) paraMiktari = guiGetText(button) triggerServerEvent("SendMoney1",getRootElement(),paraMiktari,name)endaddEventHandler("onClientGUIClick", start, sendm, false)