-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
you have to use the key "score" with a minus s
-
Sorry but you will have to convert them all. http://www.jpkeisala.com/blog/2009/01/0 ... -encoding/
-
and texts must be surrounded with " local vartext = "queissoooooooooooooooooooooooooooooooo"
-
So when you die, you are respawning twice right ? If yes then you have to find out which resources or parts of your resource that uses spawnPlayer function with a timer in a onPlayerWasted event
-
It does work if you read and do the setup correctly: - Install a mysql server and create a database in it. - Import the sql dump from the resource folder into your new fresh database. - Edit the databaseConfig in roleplay-accounts/s_webserver.lua to let the script be able to connect to your mysql server and your fresh database. - Add all resources into the ACL admin group - Start the server - Enjoy
-
Ok one more (and hope the last) time: Requirement: When you are doing the INSERT query to register the player account, make sure you put the hashed password in that query. EDIT: @Wei: it's a bad practice to get compare the password in the script when you can just let the SQL server do it for you. With my query, it won't get and return the useless datas if the username and password doesn't match. When using this script (to check if the login/password are good), you have to give the query the username and the hashed password. Here is what the query means (i.e, the username is "KRZO" and the hashed password is "abcd"): - Please give me the value of all columns of all the lines from the table accounts that have KRZO in the column username and that also have abcd in the password column. So normally, there is only one line in the table that has KRZO in the username column. But now imagine the hashed password is "wxyz", the sql server will do something like: - Well, I found 1 line in the table with the username KRZO but the hashed password isn't wxyz so no, there is no result for your query man. Can't explain the query better than this, so I hope you will understand.
-
No, I didn't, I just said that if not false then -- or if not nil then -- or if not 0 then would have the same behaviour than if true then But I was wrong about if not 0 then because it's actually the same as: if not true then --or if false then
-
This: https://github.com/mabako/mta-paradise or this: https://github.com/Socialz/lua-mta-fairplay
-
Why are you doing a comparison between nil and false ?? I never talked about false and next returns nil if there is no value in the table after the index. By the way you were right since the begining because I just discovered that not 0 returns false In Lua: print( not nil ) -- prints true print( not false ) -- prints true print( not 0 ) -- prints false In C++ (11): #include <iostream> using namespace std; int main() { printf( !NULL ? "True" : "False" ); //prints True printf( !false ? "True" : "False" ); //prints True printf( !0 ? "True" : "False" ); //prints True return 0; } So yeah your code is working because 0 is considered as a true value in Lua.
-
Not sure if you didn't explained correctly due to your english skill or if you are really doing a comparison between both of them.
-
Already saw it in some loops but I never worked with it. By the way your statement isn't correct, it should be: if next( getVehicleOccupants( veh ) ) ~= nil then This way it will really check if the vehicle is empty because if nil then and if 0 then will do the same effect. Check this example I juste made: http://ideone.com/yEhkY9
-
Full code please? Just try, you are supposed to work for your server.
-
He mean't folder (Carpeta = folder in spanish)
-
It was defined in the for loop: for index, thePlayer in ipairs(getElementsByType("player")) do
-
@Controlled: Well, this problem is because the SQL connection failed. Socialz didn't handle this. @JJuane: The first error: [2014-03-10 16:56:58] ERROR: roleplay-accounts\s_webserver.lua:85: attempt to index global 'databaseConfig' (a nil value) Is bug that Socialz introduced in his code. But isn't a problem if you aren't using the web interface. I'll send a pull request to him when I'll fix it on my side. By the way, the real problem is coming from you. Here are the possible reasons: 1 - The db connection details aren't correct (ip, login, password, database name local databaseConfig = { ["type"] = "mysql", --Do not modify ["table"] = "", --The database name you created in phpMyAdmin ["hostname"] = "127.0.0.1", --The ip of the MySQL server (127.0.0.1 means the local computer) ["username"] = "", --The login ["password"] = "" --The password } 2 - Your MySQL server isn't started 3 - You didn't create a database in it and/or you forgot to import the sql dump in it (database.sql) (must be done with phpMyAdmin) I checked the git repo quickly but I guess there is no other possible reason. EDIT: Pull request sent: https://github.com/Socialz/lua-mta-fairplay/pull/1
-
is already in the script 800x600x32 fixed <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,, Wasn't in the script at all lol. Try this then: local button = guiCreateButton(0.1125, 0.542, 0.25, 0.0667, "", true) And voila, it's will be exactly at the same place in all resolutions (and exactly the same place where your code was actually positioning it) If it's not what you wanted, then please provide screenshot(s).
-
Et pourquoi ce n'est pas lui qui vient poster vu que c'est lui qui s'en occupe ? Aussi quand on colle du code lua, on le colle dans les balises lua comme ceci: [lua][/lua] Y a un bouton "lua" dans la barre sur la droite quand tu écris un message qui ajoute les balises, t'as plus qu'à coller entre les 2. ------------------------------------------------------------------------------------ Latitepingouin said: apparemment y a pas de message d'erreur ------------------------------------------------------------------------------------ Oh si y en a, mais comme c'est du code du côté client (n'est pas executer sur le serveur mais sur le pc du joueur) tu ne verras rien dans la console du serveur. Pour voir les erreurs du côté client, il faut se connecter au serveur et taper /debugscript 3 (ne marche que si tu t'es /login en administrateur) Si vous n'y arrivez pas, les logs sont dispo ici: C:\Program Files (x86)\MTA San Andreas 1.3\MTA\clientscript.log Si ce fichier est trop gros pour être ouvert, supprimez-le et relancer votre gamemode où se trouve ce script. Mais ça vous êtes censé le savoir car vous êtes censé avoir lu les tutos pour commencer à scripter: FR: https://wiki.multitheftauto.com/wiki/FR/ ... grammation https://wiki.multitheftauto.com/wiki/FR/Debugage Il est aussi interdit (dans le language) de dupliquer de code. Le code que je vous ai donné permet à une liste de joueurs définit de pouvoir utiliser la commande "/monskin" afin qu'ils puissent se mettre un skin particulier. La syntaxe de cette commande c'est: /monskin Donc /monskin ne marchera jamais avec mon code puisqu'il a pas l'id dont il a besoin. En dupliquant l'intégralité du code pour le coller juste en-dessous sans remplacer le nom des fonctions, commandes et le nom du tableau, vous pétez tout ce qu'il y a au-dessus. Je vois exactement ce qu'il a essayé de faire, mais c'est pas du tout comme ça qu'il fallait faire. Il fallait modifier mon code pour modifier son comportement au lieu de le dupliquer. Et d'avance, je vous réponds: non, je ne vais pas modifier le code à votre place. Il va falloir être motivé et suivre les tutos que j'ai linké au-dessus. Cordialement, Citizen
-
Ok, give me the resolution in which the button is placed correctly.
-
just use this function: https://wiki.multitheftauto.com/wiki/IsVehicleEmpty exemple: if not isVehicleEmpty( veh ) then -- there is someone inside. end
-
There is no xxx.sql file in your resource's folder. That's the point of using a MySQL server. You have to install wamp for exemple on Windows. It includes a MySQL server. You can then manage your MySQL server using the link: http://localhost/phpMyAdmin or http://localhost:8080/phpMyAdmin By default the login and password are "root" and no password. Just read this damned readme ...
-
Every times you are asking for help, I can't understand what you are saying. Please edit your question and use google translate (write everthing in your own languate and then translate it). Or ask a friend that speak your language and ask him to translate it in english for you. I guess your problem is that if a player reconnects, then his name is shown twice in the scoreboard. But i'm not sure at all.
-
Try this: local soundQueue = {} local currentSound local canPlay = true function playLatentSound( path ) if not path or type( path ) ~= "string" then return end local snd = playSound( path ) if not canPlay then setSoundPaused( snd, true ) table.insert( soundQueue, snd ) else currentSound = snd canPlay = false end end function whenSoundStops ( ) if source ~= currentSound or #soundQueue < 1 then return end local nextSnd = soundQueue[1] if nextSnd and getElementType( nextSnd ) == "sound" then setSoundPaused( nextSnd, false ) table.remove( soundQueue, 1 ) currentSound = nextSound else canPlay = true end end addEventHandler( "onClientSoundStop", root, whenSoundStops) Use playSoundLatent instead of playSound. Note that this system obviously won't support the looped argument. (I wrote everything from my phone. Took me a lot of time but I hope it will work.) I just got another idea if you need to prevent the sound mixing for all sounds (even those that are coming from other resources.
-
Because you didn't read the code. Read it carefully with the wiki and try to modify it. We aren't here to script your server. At least try.
