
drk
Members-
Posts
1,607 -
Joined
-
Last visited
Everything posted by drk
-
Because you fade camera but don't put normal again.
-
Client-side: function createLoginWindow() -- define the X and Y positions of the window local X = 0.375 local Y = 0.375 -- define the width and height of the window local Width = 0.25 local Height = 0.25 -- create the window and save it's element value into the variable "wdwLogin" -- click on the function's name to read its documentation. wdwLogin = guiCreateWindow(x, y, Width, Height, "Please login with your username and password", true) -- define new X and Y positions for the first label. X = 0.0825 y = 0.2 -- define new Width and Height values for the first label. Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window). guiCreateLabel (X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value so the second label is slightly below the first. 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) -- set the maximum character length for the username and password fields to 50. guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- now add our onClientGUIClick event to the button we just created. addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) -- make the window invisible guiSetVisible(wdwLogin, false) -- create the function and define the 'button' and 'state' parameters. -- (these are passed automatically by onClientGUIClick) function clientSubmitLogin(button,state) -- if our login button was clicked with the left mouse button, and the state of the mousebutton is up: if button == "left" and state == "up" then -- get the text entered in the 'username' field. local username = guiGetText(edtUser) -- get the text entered in the 'password' field. local password = guiGetText(edtPass) -- if the username and password both exist: if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it. triggerServerEvent("submitLogin", getRootElement(), localPlayer, username, password) -- move the input focus back on the game (allowing players to move arround, open the chatbox, etc) guiSetInputEnabled(false) -- hide the window and all the components. guiSetVisible(wdwLogin, false) -- hide the mouse cursor. showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui. outputChatBox("please enter a username and password.") end end end end -- attach the event handler to the root element of the resource. -- this means it will only trigger when it's own resource is started. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () -- create the log in window and it's components. createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to BlackDeath's Alpha Server, Please log in with the login information provided to you") -- if the GUI was successfully created, then show the GUI to the player. if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasn't been properly been created, tell the player. outputChatBox("An unexpected error has occurred and the login GUI has not been created.") end -- enable the players cursor (so that they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening. guiSetInputEnabled(true) end ) -- attach the event onClientGUIClick to btnLogin and set it to trigger the 'clientSubmitLogin' function. addEventHandler("onClientGUIClick", btnLogin, clientSumbitLogin, false) Server-side: function loginHandler(client,username,password) -- check that the username and password are correct. local acc = getAccount(username, password) -- the player has succesfully logged in, so spawn them. if (acc) then spawnPlayer (client, 1959.55, -1714.46, 10) faceCamera(client, true) setCameraTarget(client, client) outputChatBox("Enjoy your time!", client) else -- if the username or password are not correct, output a message to the player. outputChatBox("invalid username and password. Please re-connect and try again.", client) end end addEvent('submitLogin',true) addEventHandler('submitLogin',root,loginHandler)
-
local acc = getAccount ( username, password ) if ( acc ) then -- Your code here else outputChatBox ( "Account not found!" ) end end
-
Because your script is totally copied from Wiki. Your code verify if username is user and password apple. You need delete this and use getAccount to verify if account exists, if exists login, else output error. You must start learn: https://wiki.multitheftauto.com/ http://lua-users.org/wiki/TutorialDirectory
-
Open your mtaserver.conf, put your server name with these characters in node. Then, save the file with UTF-8 text format.
-
You can simply rename the variable from "S.W.A.T" to "SWAT".
-
+1 You completely destroye him at the end of your message +1 Oh, "scriptter" like you said, if I'm noob, show your Lua skills ^^
-
This sucks. This is stolen and downloaded resources.
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
The problem is: data "Group" don't exists, only in your local cause you are using a group resource. -
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
Funny is: I corrected your code and you posted your wrong code again. -
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
Cause I don't know how group have been created, then I can't say how you can verify if the player is a group member. And Josh, your code is wrong dude. Stop posting this. -
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
LOL Then we can't help you. -
Maybe this too: www.lua-users.org/wiki/TutorialDirectory
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
Obviously don't work. "Group" data do not exists. You need change getElementData ( player, "Group" ). Is your group in DXScoreboard ? ( Press Tab to see ) -
Because in 2 argument you need use NUMBER not STRING. @@GanJaRuLeZ - This is what you need: Learn.
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
Nop I have only played 1 time. EXTREME LAG!!! -
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
LOL Then, I can't help u. I need know how you create the team / group. -
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
Is your group a Team in the server? Like, you used createTeam or Admin Panel create Team function or smth like that? -
It's not to increase my rank. If you don't wanna learn, don't create it lol I've seen in the old posts, you want to others create the script to you..
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
idk lol You have to know how you created your "group" and you need verify by anything the player haves. -
We will not create it for you. Learn and create it by yourself.
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
you need change getElementData ( player, "Group" ) and put your code to see if the player is in the group. -
lol? You have only changed a simple things in my code. Same as mine dude, stop posting only to get better rank lol
-
How to Make Gate Opened Only when Group Member are near that
drk replied to Jokeℝ1472771893's topic in Scripting
local allowedGroups = { ["Groupname"]=true } col1 = createColSphere ( x, y, z, radius ) gate1 = createObject (modelid, x,y,z) function openGate1 ( player ) if ( allowedGroups [ getElementData ( player, "Group" ) ] ) then moveObject (gate1, milliseconds,x,y,z ) end end addEventHandler("onColShapeHit", col1, openGate1) function closeGate1() moveObject(gate1, milliseconds,x,y,z) end addEventHandler("onColShapeLeave", col1, closeGate1) -
Good map but no originality.