Misha

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Misha

  • Rank
    Advanced Member
  1. After some help: local users = { Misha = "noob", Faberge = "Faberge" } local function isValidAccount( username, password ) return username and password and users[ username ] == password end function loginHandler( username, password ) if client == source then if isValidAccount( username, password ) then spawnPlayer( source, 1479.6,-1612.8,16.56 ) fadeCamera( source, true ) outputChatBox( "Welcome", source ) else outputChatBox( "Failed. Relog.", source ) end end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) function createVehicleForPlayer(thePlayer, command, vehiclemodel, vehiclecolor) local x,y,z = getElementPosition(thePlayer) x= x + 2 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) if (createdVehicle ==false) then outputChatBox("You Fail, try again.",thePlayer) end end addCommandHandler("makeveh", createVehicleForPlayer) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source) .. " Fail!") end addEventHandler("onPlayerWasted",getRootElement(),playerDied) function moveThePlayer(x,y,z,rotation) if x and y and z and rotation then local skin = getElementModel(client) spawnplayer(client,x,y,z,rotation,skin) setCameraTarget(client,client) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer) That was script.lua addEventHandler("onClientResourceStart", getResourceRootElement(), function () 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(), 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 ) 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", getLocalPlayer(), 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 = guiGetScreenSize() local Width, Height = 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 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("onClientGUIClick", teleportButtonLS, teleportPlayer, false) addEventHandler("onClientGUIClick", teleportButtonSF, teleportPlayer, false) addEventHandler("onClientGUIClick", teleportButtonLV, teleportPlayer, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createRulesWindow() createTeleportWindow() showCursor(true,true) end ) function openTeleportWindow() 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 gui.lua gui.lua seems to be fine at the moment, but i have an issue - The player is not spawning.
  2. I am sorry for being late. Debug (SS) http://img291.imageshack.us/img291/1272/debug.png (2 monitors, second shows the gui script itself. (script currently) addEventHandler("onClientResourceStart", getResourceRootElement, function () 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", getResourceRoot, createTeleportWindow) 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 Updated, got rid of the line 2 error, stuck on line 174 now. script.lua is unchanged. EDIT: GUI is fixed, teh script finally starts. Now there are issues in script.lua. Player model doesn't appear. After ogging in you're basically looking into the sky.
  3. No, i have not. I will as soon as i get time to head in-game.
  4. At this moment, when i started the gamemode in server, i had no errors. Though when i go in-game, iam confronted with a black screen with the only message being "Welcome to My Server."
  5. Basically, i tried to make my own gamemode, a base for future testing. I made it based on the tutorials and modded the things i felt comfortable to mod. I got it written and got my first notes of wisdom, but when i started teh script and logged on, i was only met by a black screen. THe script includes 2 files atm - script.lua and gui.lua(under /client). Meta is correct. script.lua function joinHandler() local x = 1959.55 local y = -1714.46 local z = 15 outputChatBox("Welcome to My Server", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) function loginHandler(username,password) if username == "Misha" and password == "noob" then if (client) then spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) outputChatBox("Welcome", client) end elseif username == "Faberge" and password == "Faberge" then if(client) then spawnplayer(client,1959.55, -1710.46, 10) fadecamera(client, true) outputChatBox("Welcome.", client) end else outputChatBox("Failed. Relog.",client) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) function createVehicleForPlayer(thePlayer, command, vehiclemodel, vehiclecolor) local x,y,z = getElementPosition(thePlayer) x= x + 2 local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) if (createdVehicle ==false) then outputChatBox("You Fail, try again.",thePlayer) end end addCommandHandler("makeveh", createVehicleForPlayer) function playerDied(totalAmmo, killer, killerWeapon, bodypart) outputChatBox(getPlayerName(source) .. " Fail!") end addEventHandler("onPlayerWasted",getRootElement(),playerDied) function moveThePlayer(x,y,z,rotation) if x and y and z and rotation then local skin = getElementModel(client) spawnplayer(client,x,y,z,rotation,skin) setCameraTarget(client,client) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer) Gui.lua 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 If you are bored enough to help me, i will be glad. I like to try things. I would not post this if i wouldn't have been frustrated with it for a week, which is probably dumb. Thank you for reading this to the end, if you did.
  6. Las Venturas is nothing but a distant memory for most of us but we still hadn't got around to creating a new Los Santos based server trailer. ...until now. This trailer focuses on story hinting at some of the characters and situations that can be found in Los Santos. There is no mention of the amazing server features this time around as by now everyone knows our script is packing a serious punch when it comes to those. A big thank you to all the players that helped me with filming. You can view the trailer on the Valhalla Gaming MTA website or on the VG MTA YouTube channel. Enjoy!
  7. https://www.youtube.com/watch?v=wSTcwgp4bgo https://www.youtube.com/watch?v=57vboXmovh4 https://www.youtube.com/watch?v=3531109obbI https://www.youtube.com/watch?v=1yVAU_n9RUI https://www.youtube.com/watch?v=yl2BeeMvKE0 https://www.youtube.com/watch?v=wYIMDS8u8tw About 45 minutes of content, hopefully can give you a little glimpse on the RP part of MTA. Too bad you can't add material from our trailers. I'll work on presenting 720p material on our features.
  8. Half the features look like direct copies. Loking forward to see some interesting advancements though.
  9. Our server has any info you need posted to the server information and and annoucements forum. We are not always on the newest nightly versions.
  10. Misha

    Public beta #2 details

    It was a great test. vG MTA RP server was full and i had no lag. The people that had average gaming PC's all had no lag whatsoever. Not a single crash, all perfect. Very enjoyable.
  11. Just a small note. vG MTARP is a RP server, a RolePlay server, notably different from RPG aka RolePlaying Game. In RPG you only have basic elements of character development, in RP you have character story, consequential mindset and more feature to portray life(balanced to keep it fun of course). It's great to have the test on the server, i'm really looking forward to it.
  12. The server lag has been reduced to mere nothing. A few nights ago we achieved 34 players, something very, very rare for nightlies. Right now though we have a crash problem with the newest nightly, so the server might crash every once in a while.
  13. The first EVER Mta RolePlay server is finally, after a lot of tears and blood, going live! 21:00 GM +0 on Nightly r606 version(That also makes it the first full release of a server on a nightly.). Be there! For more info, visit http://www.valhallagaming.net/forums/sh ... post405969 or http://www.valhallagaming.net/forums/index.php