-
Posts
83 -
Joined
-
Last visited
Everything posted by Chopper
-
okay, so im having a small problem with timers, i have a function, lets just say, for example, i have a function which outputs something to the chat. Now i want to make that function, execute, every 30 minutes, for example. How can i do that? My other question is about GUI. how can i do that, for example, i have a command. and an arguement, that is a player name. so for example, my command is /h Josh. I want a gui window, to open for the player with the name "Josh", when i enter the command. Thanks for the help.
-
They are there for testing purposes, i was trying to figure the problem out, thats why they are there.
-
I dont have a GUI Window. Heres my script. function login(player) outputChatBox(source) lathatoE = guiGetVisible(test) if not lathatoE then showCursor(true) fadeCamera(source, true, 5) setCameraMatrix(2442.1264648438,-1649.2254638672,28.584239959717, 5000, -500,-500) test = guiCreateStaticImage(0, 300, 413, 150, "bg1.png", false) test2 = guiCreateStaticImage(399, 202, 485, 357, "bg2.png", false) test3 = guiCreateStaticImage(868, 300, 413, 150, "bg1.png", false) felhnevBox = guiCreateEdit(541, 302, 201, 27, "", false) pwBox = guiCreateEdit(541, 422, 201, 27, "", false) loginButton2 = guiCreateStaticImage(553, 447, 178, 100, "loginBut.png", false,test) addEventHandler("onClientGUIClick",loginButton2, tryLogin, false) GuiSetEnabled(test,false) GuiSetEnabled(test2,false) GuiSetEnabled(test3,false) dxDrawImage(405, 212, 462, 333, "bg1.png",0, 0, 0, tocolor(255, 255, 255, 255), true) end end addEventHandler("onPlayerJoin", getRootElement(), login)
-
Not really sure what you mean. I have the handler like this: addEventHandler("onClientGUIClick",loginButton2, tryLogin, false) and the loginButton2 is: loginButton2 = guiCreateStaticImage(553, 447, 178, 100, "loginBut.png", false)
-
Hello. So, i have a login panel made with Static Images. I have an onClientGUIClick eventhandler, for the loginButton element. Clicking on the button, i created a function, it works. But if i click anywhere else on the panel that is a gui Image, it does this. The original panel: Anyone have any idea whats wrong with it? Im sure its not the coding, since its just the panel with an event pointing to another function.
-
The MTA Wiki is always a good place to learn it. You can find basically everything on it.
-
Specific Position? Well, you could attach it to something, right? for example, a player, object, vehicle. use attachElements
-
I dont really get what you mean, you can use dxDrawText
-
There isnt any event called onPlayerEnter1.
-
People here dont give support with leaked scripts.
-
in this type of script, he needed it as a clientside. i said it kinda wrong, but true, ill edit the post in a sec.
-
you can do this for serverside. Triggers the client event showChat, when a player logs in. Since you need showChat as a client side function, you have to use triggerClientEvent. Server function showChat() triggerClientEvent("showChat", getRootElement) end addEventHandler("onPlayerLogin",getRootElement(),showChat) Client function showChat() showChat(true) end addEvent("showChat", true) addEventHandler("showChat",getRootElement(), showChat) Didnt test, should work fine though.
-
I dont really understand..
-
addEventHandler("onClientPlayerSpawn", root, function() JoinMusic = playSound("music/welcome.mp3") setTimer ( stopMusic, 5000, 1) end) function stopMusic() stopSound(JoinMusic) end
-
Why dont you just use this. mysql_host = "127.0.0.1" mysql_user = "root" mysql_pass = "yourpass" mysql_db = "yourdb" db_import = mysql_connect(mysql_host,mysql_user,mysql_pass,mysql_db) Much easier. but you can also try using sql:query
-
Tbh no point in securing it that much, if there is no vulnerability to access the DB[sqli].
-
You're welcome.
-
Exactly what he is saying, forgot to add that. Use md5, sha1, or even sha256.
-
<?php if (isset($_POST['submitb'])) { //If the submit button was pushed $username = $_POST['username']; //Lets get the HTML Info $password = $_POST['password']; //config $db_host = "localhost"; $db_user = "root"; $db_pass = "your password"; $db_name = "your database name"; $kapcs = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name); $query = "INSERT INTO users (username,password) VALUES('$username','$password')"; //Inserting data to db. $doquery = mysql_query($query,$kapcs); print "Registration Successful.<br>"; //Successful registration. header('refresh:3;url=index.php'); //Redirect to index.php in 3 seconds. } } else { //Print the original HTML Form you are using. print '<form method="POST" ACTION="">'; print '<input type="text" size="30" name="username" maxlength="32" placeholder="Username"><br><br>'; print '<input type="password" size="30" name="password" maxlength="32" placeholder="Password"><br><br>'; print '<input type="submit" value="Register!" name="submitb">'; print '</form>'; } ?>
-
Sure, give me a few minutes.
-
You can do that with PHP. an HTML form, to insert the data into, a PHP script to get the data out of it and insert it to a mysql database.
