Jump to content

BigBrother

Members
  • Posts

    14
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BigBrother's Achievements

Square

Square (6/54)

0

Reputation

  1. Hello, I've done a script which kick a player who is not in the database. To do so, I use this script function isPlayerRegistred() joinPlayerName = getPlayerName(source) exports.sql:connectMySQL() local result = mysql_query(db, "SELECT * FROM users WHERE username = '"..joinPlayerName.."'") local row = mysql_fetch_row(result) if (row == nil) then outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("Votre compte n'est pas enregistré. Veuillez vous inscrire sur notre plateforme web.", source, 185, 74, 72, true) kickPlayer (source) else spawnPlayer(source, 0.0, 0.0, 3.0) fadeCamera(source, true) setCameraTarget(source) outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("Bienvenue sur WeRoleplay, #FFFFFF"..joinPlayerName, source, 153, 153, 153, true) outputChatBox("Veillez à bien respecter les règles du serveur.", source, 153, 153, 153, true) outputChatBox(" ", source, 255, 255, 255, true) mysql_free_result(result) end end addEventHandler("onPlayerJoin", root, isPlayerRegistred) And I have an error : Access denied @ kickPlayer Which line of the ACL should I use to enable the kick function in this case ? Thanks,
  2. Hello, I'm beggining my server, and for the moment there is two main resources : sql and account In the SQL, I have a sql.lua file where in i'm connecting to the database and a meta.xml where in i'm exporting the function which enables me to connect to mysql. SQL.LUA function connectMySQL() db = mysql_connect(db_host, db_login, db_pass, db_name, db_port) if (db) then -- The connection failed outputDebugString("Connected.") triggerEvent("onMySQLConnected", root) else outputDebugString("Unable to connect to the MySQL server") end end addEventHandler("onResourceStart", resourceRoot, connectMySQL) meta.xml (of the SQL resource) <meta> <info author="BigBrother" version="1.0" type="gamemode" name="WeRoleplay"/> <!-------- SCRIPTS --------> <script src="sql.lua" type="server" /> <!-------------------------> <!-------- CONFIGS --------> <!-------------------------> <export function="connectMySQL" http="true" /> </meta> And a second resource named account where in I have a meta.xml and a login.lua file LOGIN.LUA function isPlayerRegistred() joinPlayerName = getPlayerName(source) db_import = exports.sql:connectMySQL() local result = mysql_query(db_import, "SELECT * FROM users WHERE username = '"..joinPlayerName.."'") local row = mysql_fetch_row(result) print(row) if (row == nil) then outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("Votre compte n'est pas enregistré. Veuillez vous inscrire sur notre plateforme web.", source, 185, 74, 72, true) else spawnPlayer(source, 0.0, 0.0, 3.0) fadeCamera(source, true) setCameraTarget(source) outputChatBox(" ", source, 255, 255, 255, true) outputChatBox("Bienvenue sur WeRoleplay, #FFFFFF"..joinPlayerName, source, 153, 153, 153, true) outputChatBox("Veillez à bien respecter les règles du serveur.", source, 153, 153, 153, true) outputChatBox(" ", source, 255, 255, 255, true) mysql_free_result(result) end end addEventHandler("onPlayerJoin", root, isPlayerRegistred) Meta.xml (of the account resource) <meta> <info author="BigBrother" version="1.0" type="resource" name="WeRoleplay"/> <!-------- SCRIPTS --------> <script src="login.lua" type="server" /> <!-------------------------> <!-------- CONFIGS --------> <!-------------------------> </meta> The two lua.sql files used to be regroup in one file, so it used to work, but now I have this error : [2013-10-13 20:05:12] ERROR: [WeRoleplay]\account\login.lua:16: bad argument #1 to 'mysql_query' (mysqlHandler expected, got nil) Could you Help me, please. - BigBrother
  3. Bonjour, Bonsoir, je n'ai pas très bien compris comment fonctionner un serveur MTA. En effet, dans mes dossiers, j'ai un dossier deathmatch qui contient l'executable et de nombreuses ressources, des dossiers de base de données etc ... J'aime pas les trucs prédéfinis, alors savez-vous qu'elle devrait être la procédure à suivre si je veux créer un gamemode de A à Z sans passer par les ressources déjà mises en place ? Merci d'avance pour vos réponses
  4. Hello, I'm starting a new roleplay gamemode, and I'd like to optimize it. I don't want to make SQL requests at each time I have to change a user data, so I had the idea to create a table at the connection of the user, and to store in it all the informations which could be changes during the game session. At the logout, I just have to make a request to update all the content of the table in the SQL table But, using this method requires to create a table for each connected player, so How can I create dynamicly a table ? Regards,
  5. Thanks, But now, I'd like to divide my ressource into subfolder Like Myserver/ MSchat/*.lua MSadmin/*.lua meta.xml So how can I make the connection in the root meta.xml file to the subfolders ?
  6. Yes, but How to make the server.exe launch and base itself on MyServer and not on deathmatch ?
  7. Hello Guys, In my mod's folder (in server folder), I have a folder : deathmatch. I'd like to create a brand new project and start from scratch. So I can I do ? Cause currently, I just have a ressource folder in my ressource in : MTASA\server\mods\deathmatch\resources named Roleplay What should I create as files and folder to create a new gamemode ? Regards
  8. Thanks, but How could I use it ? It's between two points, and not really a "region" How to make a system like that : Show the /me command only to the player in the region of a 10 meter radius ...
  9. Hello guys, I'd like to create a /me command, I know how to make it but I'm locked on a point ... How to limit the display distance ? If I want to display the /me text in a range of 10 meters for exemple, how could I script it ? Regards,
  10. I need help, please. Regards,
  11. Hello guys, In ordre to improve my roleplay server, I'd like to know if it was possible to create a script in which I could drop objects like guns / drugs / money ... on the ground and to loot it ? I have to use a coordinate system ? If yes, how ? Regards,
  12. Hello guys, I'd like to know if LUA supports the MD5 + salt 's encryption method ? Or if it doesn't, which method of encryption could I use ? Thanks.
  13. Salut, On ne sait rien sur ton projet, sur sa genèse, ses objectifs, son originalité, ton équipe, ton avancement etc ... Comment veux-tu que quelqu'un soit intéressé si tu ne nous ne précise pas ces éléments ?
×
×
  • Create New...