Jump to content

=KoG=Rouche

Members
  • Posts

    220
  • Joined

  • Last visited

Everything posted by =KoG=Rouche

  1. bindKey is not working for me too its wreid 0.o
  2. New Problem with the script. Now the problem when ppl join or quit when someone is using the login panel is fixed but ... If there is nobody on the server ... i press a button on the panel and only the dx elements disappear. All the GUI elements stay displayed ! I think the panel generate two times the GUI element. I don't know why :-/ Cuz when i join server i begin to type my nickname in loginEdit and when tha map is loaded, the loginEdit and passwordEdit are back to default text ... when i close the panel by pressing a button i can see the old loginEdit and passwordEdit with my nickname i was writting a few seconds ago.
  3. I think my problem is that serverside 'll trigger the clienside of all player and make panel bug. How to trigger from serverside to 1 clientside only ? (The client which must be triggered is the newcomer, you if you just join the server) Serverside : addEvent("onRegister",true) addEventHandler("onRegister",root, function ( player, user, pass ) -- Here is the register function end ) addEvent("onLogin",true) addEventHandler("onLogin",getRootElement(), function (player, user, pass) -- here is the login function end ) -- Here is the first function called function goToCreateGUI() triggerClientEvent("guiCreateClientside",getRootElement()) end addEventHandler("onResourceStart",getRootElement(),goToCreateGUI) Clientside : -- ScreenSize screenX, screenY = guiGetScreenSize(); -- ... flag = 0 -- Buttons Functions function clientLogin(button,state) if button == "left" and state == "up" then triggerServerEvent("onLogin",getRootElement(),getLocalPlayer(),guiGetText(loginBox),guiGetText(passwordBox)) flag = 1 hideLoginPanel() end end function clientRegister(button,state) if button == "left" and state == "up" then triggerServerEvent("onRegister",getRootElement(),getLocalPlayer(),guiGetText(loginBox),guiGetText(passwordBox)) flag = 1 hideLoginPanel() end end function clientGuest(button,state) if button == "left" and state == "up" then flag = 1 hideLoginPanel() end end function render() if (flag == 0) then -- Red Rect rectRed = dxDrawRectangle(HereIsMyArgs) -- All dx element are created here ... else hideLoginPanel() end end function CreateGUI() if (flag == 0) then -- Buttons buttonL = guiCreateButton(HereIsMyArgs) buttonR = guiCreateButton(HereIsMyArgs) buttonG = guiCreateButton(HereIsMyArgs) -- EditBox loginBox = guiCreateEdit(HereIsMyArgs) passwordBox = guiCreateEdit(HereIsMyArgs) guiEditSetMaxLength(HereIsMyArgs) guiEditSetMaxLength(HereIsMyArgs) guiEditSetMasked(HereIsMyArgs) addEventHandler("onClientGUIClick",buttonL,clientLogin) addEventHandler("onClientGUIClick",buttonR,clientRegister) addEventHandler("onClientGUIClick",buttonG,clientGuest) else hideLoginPanel() end end addEvent("guiCreateClientside", true) addEventHandler("guiCreateClientside", getRootElement(), CreateGUI) -- Hide the Login Panel function hideLoginPanel() if(flag == 1) then removeEventHandler("onClientRender",getRootElement(),render) destroyElement(buttonL) destroyElement(buttonR) destroyElement(buttonG) destroyElement(loginBox) destroyElement(passwordBox) showCursor(false) end end addEvent("onHide", true) addEventHandler("onHide", getRootElement(), hideLoginPanel) function onClientJoin() CreateGUI() outputChatBox("Passer CreateGUI()") end addEventHandler("onClientPlayerJoin",getRootElement(),onClientJoin) if(flag == 1) then removeEventHandler("onClientRender",getRootElement(),render) else addEventHandler("onClientRender",getRootElement(),render) end
  4. I've another problem. When there is already 1 player on the server the GUI are never displayed until the next map is loaded ! So the dx elements are displayed without gui elements and the newcomer has to wait for the next map. Maybe i can work with the state of the player ? ... Waiting, Ready ... ? What is the clientEvent ? It's anoying :-/ Any idea ?
  5. I found the answer here https://wiki.multitheftauto.com/wiki/OnClientResourceStart.
  6. I found a way to do what i want, working with flags ! If you need help for that just ask me "pm". Last Problem : When a player join the server the panel is displayed ! then ... # if the player press a panel button before spawning on the map the panel works fine and disappear. OK OR # if the player use a panel button after spawning on the map, the GUI element are not destroyed .. i don't understand why :-/ (when the map start, the Login Panel seems to have some fast flash "Appear ... Disappear ... Appear ... Disappear ... Appear") Thanks for your help
  7. How can i send the guiCreateEdit content to serverside for register and login function ?
  8. And another question ^^ I created some buttons and editBox not linked to a window. For a window we use guiSetVisible(bool) but for a single button or editBox ? How to hide them ? Thanks
  9. Hi all, I'm creating a Login Panel for my server ! I've a question for u guys My Question : How to delete created rectangle (blue and grey) when the player has logged in ? Cuz it don't work like "Gui" with guiSetVisible(gui, bool). Here is the Panel : Here is a part of the Code : function onClientResourceStart(resource) function render() -- Blue Rect rectBlue = dxDrawRectangle((0.30*screenX),(0.35*screenY),(0.40*screenX), (0.30*screenY), tocolor(32, 146, 234, 255)) -- Grey Rect rectGrey = dxDrawRectangle((0.31*screenX),(0.35*screenY),(0.39*screenX), (0.30*screenY), tocolor(58, 58, 58, 255)) -- Text | Welcome on =KoG= Server | txt = dxDrawText("| Welcome on =KoG= Server |", (0.36*screenX), (0.37*screenY),(0.3*screenX), (0.1*screenY), tocolor ( 0, 178, 238, 255 ),1.8,"pricedown") end --[[ Events ]]-- addEventHandler("onClientRender", getRootElement(), render) end addEventHandler ( "onClientResourceStart", getRootElement (), onClientResourceStart ) Thanks for your help
  10. Same problem :-/ Seems there isn't a solution ...
  11. It can help me too i've the same error message :-/
  12. Is there any chance to have an upgrade for 64bits version ?
  13. Is it possible to update mta_mysql.so file with libmysqlclient.so.16 ?
  14. Hi all, I'm trying to use MySQL Database for my scripts but ... i got some problems. I followed the MTA Wiki (https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL). My server is Running on Debian 64bits, service MySQL, Apache2 and Phpmyadmin has been installed successfully (it works fine). I added the librairies as asked in MTA Wiki ! I created a folder "modules" in /mta/mods/deathmatch/ and added mta_mysql.so in it. In the meta i added this line : Here is the error i get with /debuscript 1 on my server : In MTA Server Logs i can see this line : Line 8522: [2013-11-18 23:22:44] MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type)! So i installed the "libmysqlclient.so.15" ! It doesn't work ... Can someone help me ? Here is my code (I think the problem is not from the code) : -- Default host = "127.0.0.1" -- Database Host username = "admin" -- Database Username password = "adminpassword" -- Database Password db = "mta_db" -- Database ( Where you got your tables ) handler = mysql_connect( host, username, password, db) -- Establish the connection if ( not handler ) then -- The connection failed outputDebugString("Unable to connect to the MySQL server") else mysql_close(handler) -- Close the connection end
  15. Hi all ! I use a AFK killer script and i've a big problem. Some of my players play with a JoyPad ... and the afk script detect only keybord action. So when they play, the AFK kill them for afk. Is there a way to add JoyPad action to the script ?
  16. Must i use givePlayerMoney ? EDIT The givePlayerMoney add money to GTA:SA cash but not in the cash linked to account with the userpanel. Can someone help me ? :-/ EDIT 2 I added my script to existing userpanel and it works fine ! Ty anyway =D
  17. What is "account data" ? 0.o I checked MTA Classes about Account and there is nothing about predefined variables :-/ Is cash a predefined variables ? Or i must create it ? But how can this be saved on the account player ?
  18. Source is comming from client.lua > localPlayer send to triggerServerEvent I don't understand how work cash in MTA... is it linked to MTA user Account ? For the moment i have a userpanel using "cash" and i try to make a new script using the same cash.
  19. Hello all, Here is a part of my code but the script return me this message "Error with theData !" I don"t understand why "theData" is not ok in my script :-/ function quarterHour() local account = getPlayerAccount(source) local theData = getAccountData(account, "cash") local x = 500 if( theData )then setAccountData(account, "cash", tonumber(theData) + tonumber(x)) else outputChatBox("Error with theData !") end end Thanks for help.
  20. By adding Script to Admin group it works. Thanks
×
×
  • Create New...