Jump to content

karimsqualli96

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by karimsqualli96

  1. i know i've made a init_gui and destroy_gui function, normally when the player connect to the server i will show him the login gui, if he login succefully i will not need to show the logIn dialog anymore so i detroy it using destroyElement
  2. you don't give any code, you don't give any logs file, how do you except us to help you?
  3. i slept yesterday but i can't sleep today, can you tell me why??
  4. Good but must set the timer inside the function
  5. guiSetVisible just hide the gui from the player but it still allocated on the client memory, i think destroyElement is the solution
  6. hi, i need to use 2 windows for login/register when a player connect, i declared and initialized the 2 windows and their component in the file chunk as local variable, but when the player will login i don't need them anymore so how to destroy them??
  7. use timers : https://wiki.multitheftauto.com/wiki/SetTimer
  8. how to know where can i use cancelEvent and when i cannot?? there is nothing on the wiki that indicate it
  9. cancelEvent doesn't work for onPlayerJoin: https://wiki.multitheftauto.com/wiki/OnPlayerJoin -- There isn't a cancel effect. Make sure the script has access to function.kickPlayer in the ACL. ok thanks, i gave the resource access to function.kickPlayer and it work, but i found that the server continue the execution on the function even if i kick the player, so i had to put an if-else on the whole block after the kick
  10. i have used it but nothing happen like if nothing was executed function check_account() local pName = getPlayerName(source) if(string.len(pName) <=4 or string.len(pName) >=30 or not string.match(pName, "[a-zA-Z]+_[a-zA-Z]+")) then cancelEvent(true, "invalid nickname") else fadeCamera(source, true) outputChatBox("Bienvenu dans mon serveur", source) if(getAccount(getPlayerName(source))) then triggerClientEvent(source, "showLoginGui", source) else triggerClientEvent(source, "showRegisterGui", source) end end end addEventHandler("onPlayerJoin", getRootElement(), check_account)
  11. found the solution myself : i had to provide the right to the resource to use kickPlayer function, by adding the resource to the admin group in acl.xml file
  12. hi, i've made i little script that check if the player name follow a specified pattern , and if not it will kick the player but the problem is that even if the player get the message that he will be kicked and the kickPlayer function is executed the player still connected ?? why?? function check_account() local pName = getPlayerName(source) if(string.len(pName) <=4 or string.len(pName) >=30 or not string.match(pName, "[a-zA-Z]+_[a-zA-Z]+")) then outputChatBox("Votre pseudo est invalide, veuillez mettre un pseudo de la forme : Prenom_Nom", source) kickPlayer(source) end -- ...... end addEventHandler("onPlayerJoin", getRootElement(), check_account)
  13. Ok, thanks i understand, but why making sharing variable between ressource not supported directly ?? i must make a function to return the address of the table, adding the overhead of function call
  14. hi, in order to create an account system, i want to share a variable over all ressources, i'm not sure but it is possible to do it with using a table that contain all players data and make an external function that return that table, there will be no memory access error?? cause i read that each ressource run on it own space
  15. hi, i dont understand the difference between the resource type : script and misc, both server to add content to our server no?
×
×
  • Create New...