Jump to content

[req]simple script


Recommended Posts

Posted

hey all so i need a script which should be a cylinder when i enter it a gui will open with two butoons accept and close so if u accept it will set team and roll police or anything i can change if some one can make for free or paid but prefered for free

thanks for ur patience

Posted
ok can u make it for mei really can't make it

Try to do it by yourself then post your code here and we will help you.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

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%

2vjs7it.jpg

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...