Jump to content

[help] setelement data


nasserdfdd

Recommended Posts

ok guys iam making a script where a cylinder when they enter it an press they get 12 vip time but when i press accept it give the 12 vip hour then it go away in the same time and there is no errors

script

server

local marker = createMarker (  2027.052734375, -1417.869140625, 16.9921875, "cylinder", 1.5, 255, 255, 0, 170 ) 
      
    function openwindow(hitPlayer) 
    triggerClientEvent (hitPlayer,"showwin",getRootElement(),hitPlayer) 
    end 
    addEventHandler("onMarkerHit",marker,openwindow) 
      
      
      
  
function VIP() 
    setElementData(client, "vipTime", "12") 
end 
addEvent("modPanel:setRole",true) 
addEventHandler("modPanel:setRole", root, VIP) 

GUIEditor = { 
    button = {}, 
    window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(589, 389, 520, 321, "free vip", 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 ("modPanel:setRole",localPlayer) 
    end 
end 
addEventHandler("onClientGUIClick", root, setpolice) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...