Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource(),
- function createLoginWindow()
- local X = 0.375
- local Y = 0.375
- local Width = 0.25
- local Height = 0.25
- wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true)
- X = 0.0825
- Y = 0.2
- Width = 0.25
- height = 0.25
- guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin)
- Y = 0.5
- guiCreateLabel(X, Y, Width, height, "Password", true, wdwLogin)
- X = 0.415
- Y = 0.2
- Width = 0.5
- Height = 0.15
- edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin)
- Y = 0.5
- edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin)
- guiEditSetMaxLength(edtuser, 50)
- guieditSetMaxLength(edtPass, 50)
- X = 0.415
- Y = 0.7
- X = 0.415
- Y = 0.7
- Width = 0.25
- Height = 0.2
- btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin)
- addEventHandler("onClientGUIClick", btnlogin, clientSubmitLogin, false)
- guiSetVisible(wdwLogin, false)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
- function ()
- outputChatBox("Welcome, i'm a noob.")
- if(wdwLogin ~= nil) then
- guiSetVisible(wdwLogin, true)
- else
- outputChatBox("I failed, yet again.")
- end
- showCursor(true)
- guiSetInputEnabled(true)
- end
- )
- addEventHandler("onClientGUIClick", btnlogin, clientSubmitLogin, false)
- function clientSubmitLogin(button,state)
- if button == "left" and state == "up" then
- local username = guiGetText(edtUser)
- local password = guiGetText(edtPass)
- if username and password then
- triggerServerEvent("submitLogin", getRootElement(), username, password)
- guiSetInputEnabled(false)
- guiSetVisible(wdwLogin, false)
- showCursor(false)
- else
- outputChatBox("You need a fucking username and password! LOL!")
- end
- end
- end
- function createRulesWindow()
- local sWidth, sHeight = 445,445
- local X = (sWidth/2) - (Width/2)
- local Y = (sHeight/2) - (Height/2)
- rulesWindow = guiCreateWindow(X,Y,Width,Height,"Test",false)
- guiWindowSetMovable(rulesWindow,true)
- guiWindowSetSizable(rulesWindow,false)
- rulesButton = guiCreateButton(137,394,156,37,"Sure",false,rulesWindow)
- rulesLabel = guiCreateLabel(10,25,425,359,[[
- Hello!
- This is my first server ever, that i've tried to make. In fact, this is the first real script i've ever made, even though with the help of the tutorial.
- My goal is to create a script that could become useful in vG MTA-RP. What script it is, i am not sure. I hope to create a mileage meter.
- This is me talking to myself.]], false,rulesWindow)
- guiLabelsetHorizontalAlign(ruleslabel,"center",true)
- addEventHandler("onClientGUIClick", rulesButton, acceptRules, false)
- rulesWarningTimer = setTimer(inactivePlayer,120000,1,1)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()),
- function ()
- createRulesWindow()
- showCursor(true,true)
- end
- )
- function acceptRules(button,state)
- if button == "left" and state == "up" then
- guiSetVisible(rulesWindow, false)
- showCursor(false,false)
- outputChatbox("You passed me.")
- if rulesWarningTimer then
- killTimer(rulesWarningTimer)
- rulesWarningTimer = nil
- end
- end
- end
- function inactivePlayer(status)
- if status == 1 then
- outputChatbox("Please, cope with this timer i made")
- rulesWarningTimer = setTimer (inactivePlayer,10000,1,2)
- elseif status == 2 then
- outputChatBox("You have 5 seconds, lol")
- rulesWarningTimer = setTimer(inactivePlayer,5000,1,3)
- elseif status == 3 then
- outputChatBox("I was about to kick myself. Not going to happen today, mate.")
- end
- end
- function createTelePortWindow()
- local sWidth, sHeight = guiGetScreenSize()
- local Width,Height = 231,188
- local X = (sWidth/2) - (Width/2)
- local Y = (sHeight/2) - (Height/2)
- teleportWindow = guiCreateWindow(X,Y,Width,Height,"Magic",false)
- guiWindowSetSizable(teleportWindow,true)
- guiWindowSetMovable(teleportWindow,true)
- showCursor(true,true)
- teleportLabel = guiCreateLabel(18,23,191,33,"Serious magic, bro",false,teleportWindow)
- guiLabelSetHorizontalAlign(teleportLabel,"center",true)
- teleportButtonLS = guiCreateButton(18,63,195,35,"Los Santos",false,teleportWindow)
- teleportButtonSF = guiCreateButton(18,103,195,35,"San Fierro",false,teleportWindow)
- teleportButtonLV = guiCreateButton(18,143,195,35,"Las Venturas",false,teleportWindow)
- guiSetVisible(teleportWindow,false)
- addEventHandler("onClientGUIClivk", teleportButtonLS, teleportPlayer, false)
- addEventHandler("onClientGUIClick", teleportButtonSF, teleportPlayer, false)
- addEventHandler("onClientGUIClick", teleportButtonLV, teleportPlayer, false)
- end
- addEventHandler("onClientResourceStart", getResourceRootElement(getHisResource()),
- function ()
- createTeleportWindow
- end
- )
- function open TeleportWindow
- guiSetVisible(teleportWindow,true)
- showCursor(true,true)
- end
- addCommandHandler("teleportme",openTeleportWindow)
- function teleportPlayer(button,state)
- if button == "left" and state == "up" then
- if source ==teleportButtonLS then
- triggerServerEvent ("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,0)
- outputChatBox ("You managed to not fail!")
- elseif source == teleportButtonSF then
- triggerServerEvent("movePlayerToPosition",getLocalPlayer(),-2265.5,534.0,35.0,270)
- outputChatBox("Coool")
- elseif source == teleportButtonLV then
- triggerServerEvent("movePlayerToPosition",getLocalPlayer(),2036.9,1545.2,10.8,270)
- outputChatBox("Coolest")
- end
- guiSetVisible(teleportWindow,false)
- showCursor(false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement