Jump to content

karimsqualli96

Members
  • Posts

    41
  • Joined

  • Last visited

Everything posted by karimsqualli96

  1. ok thanks, and when for exemple a type in console : start the event onResourceStart always is triggered before the client side event onClientResourceStart??
  2. hi, i want to know if when a player try to connect to the server, and a resource is already started in server side, he must load the resource before to join, so the event onClientResourceStart on client side is called before onPlayerJoin on server side??
  3. oh, shit solved, i had another error in the file base.lua so the file is not parsed that why the function add_need haven't been recognized in eat.lua
  4. hi, have 2 file : base.lua, eat.lua in the same resource, i want to call a function add_need that is defined in base.lua from eat.lua, but got an error saying that add_need is global variable that has a nil value, mean that the function isn't recognized in eat.lua how can i export it?
  5. hi, i'm a little confused about some function in client side, i can understand that function for making gui is client side, but why a function like setElementHealth or setElementModel is client side, and if for exemple i change the localPlayer model(skin) its seen to the player only or to all other players?? the second biggest problem for these client side function is security, there is a setPlayerMoney in client side, so the client can easly change the amount of money to give to himself
  6. Because of: client crash, connection timed outs, packet loss, server crash, "onResourceStop" and anything else what might make miscommunication. that what i'm doing right know, i will make server side variable and a timer ( 5 min interval ) to sync data with the client
  7. addEventHandler("onClientRender", root, function() if(guiGetVisible(GUITeleporter.window[1]) ) then local xOff, yOff = guiGetPosition(GUITeleporter.window[1], false) dxDrawImage(5 + xOff, 225 + yOff, 226, 1, ":teleporter/images/dot_white.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end ) you get the x and y position of the parent window and add it as offset
  8. hi, i'm developping a roleplay gamemode, and i wanted to write a player needs system (eating, sleeping, ...) i can make a timer in server side that decrease there variable for the player, or make the timer in client side that decrease these variable in the client side and before the player disconnect i will send the data to the server. the second aproach is more efficient for the server performance, but its safe? can a player change client side variables?
  9. hello world, i made i little script that let the player teleport him self wherever he want using x,y,z locations. he can specify interior_id and dimension too but there are optional to use the script start the resource and press [F10] or type /teleporter to show the main gui image : links github : https://github.com/karimsqualli96/mta_s ... teleporter pastebin(meta.xml) : http://pastebin.com/WNub0aAy pastebin(server.lua) : http://pastebin.com/0uYAcjDF pastebin(client.lua) : http://pastebin.com/aRJqDaAN community MTA : https://community.multitheftauto.com/index.php?p= ... s&id=10002
  10. ok, thanks, i tought there is a list of predefinied commands in mta.
  11. there is a misunderstanding, there is a predifined list of command in mta or not?? i mean without loading any resource or script.
  12. hi, i wanted to share database connection info between all my resource, and i found a file setting.xml in the same folder as acl.xml, so i thought its maybe can serve to that prupose, if its the case can you show me some exemple of code, because i don't find any documentation on the wiki
  13. hi, i'm scripting a vehicle system that restrict accessing a vehicle if the player is not the owner of that vehicle, so first i will load all vehicles from a database and put them into a table(lua table), i want to know if the vehicle element stay alaways the same after calling the function createVehicle , for exemple even if i change its color, or the vehicle explode ect .. this is essential because i will use the vehicle element as a key of my table
  14. yea i know, its local server, i have done this just for developpement, but still don't work when i type /setmoney its don't work
  15. i added all the user to the admin group ( just local server so no problem ), and i restarted the server and when i type /setmoney still not receiving any response like if if the command don't exist ps : i deleted all mta native resource this is my acl.xml name="Everyone"> name="Default">> name="resource.*">> > name="Moderator"> name="Moderator">> name="resource.mapcycler">> name="resource.mapmanager">> name="resource.resourcemanager">> name="resource.votemanager">> > name="SuperModerator"> name="Moderator">> name="SuperModerator">> > name="Admin"> name="Moderator">> name="SuperModerator">> name="Admin">> name="RPC">> name="resource.admin">> name="resource.webadmin">> name="user.*">> >
  16. hi i see that the acl file have a list of commands assosiated with defined acl like admin or moderator so i put myself on admin group and tryed to type a command but got no responce like a have writed nothing on the console : "command.stopmode" access="true"> "command.stopmap" access="true"> "command.skipmap" access="true"> "command.mute" access="true"> "command.unmute" access="true"> "command.whois" access="true"> "command.whowas" access="true">
  17. hello world, i made i little script that kick the afk players after a specified time, .. yes this is easy to do, i just wanted to share something with the community, its my first release github : https://github.com/karimsqualli96/mta_s ... afk_system pastebin(meta.xml) : http://pastebin.com/er3n8TYK pastebin(server.lua) : http://pastebin.com/fLnqyKi6 community MTA : https://community.multitheftauto.com/index.php?p= ... ls&id=9983
  18. thanks but a found a better solution : local acc = getAccount(getPlayerName(client), password) if( acc ) then logIn(client, acc, password))
  19. Wow !! best Resource ever, there is a realease date??
  20. hi, i want to delete the message that its automaticly send by the account system
  21. ok, thanks you that what i needed to know
  22. hi i want to know if the function getPlayerAccounts get the account from the player only if he has already logIn using the logIn function or even if the player haven't logIn
  23. you should post us some code to know why its don't work
  24. hi, after reading the wiki event system many time, i still don't understand it very well, the part that i dont understand is the second argument of addEventHandler , the one that indicate what element the handler is attached to, i don't understand when the handler will be or not be called(according to wich is the source element that triggered this event). an exemple of code function init_gui() GUILogin = { button = {}, window = {}, edit = {}, label = {} } GUILogin.window[1] = guiCreateWindow(325, 269, 364, 161, "Menu ~~ Connexion", false) guiWindowSetSizable(GUILogin.window[1], false) GUILogin.label[1] = guiCreateLabel(10, 87, 99, 23, "Mot de passe :", false, GUILogin.window[1]) guiSetFont(GUILogin.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUILogin.label[1], "center", false) guiLabelSetVerticalAlign(GUILogin.label[1], "center") GUILogin.edit.password = guiCreateEdit(109, 87, 245, 23, "", false, GUILogin.window[1]) GUILogin.label[2] = guiCreateLabel(10, 24, 344, 53, "Bonjours, Notre systéme indique que vous avez deja un \ncompte, veuillez inserer votre mot de passe pour vous \nconnecter. si ce n'est pas le cas veuillez changer de nom", false, GUILogin.window[1]) guiLabelSetHorizontalAlign(GUILogin.label[2], "center", false) guiLabelSetVerticalAlign(GUILogin.label[2], "center") GUILogin.button.login = guiCreateButton(10, (161 - 27) -10, 98, 27, "Connexion", false, GUILogin.window[1]) GUILogin.button.register = guiCreateButton(364 - 98 - 10, (161 - 27) -10, 98, 27, "Connexion", false, GUILogin.window[1]) guiSetVisible(GUILogin.window[1], false) end addEventHandler("onClientResourceStart", getResourceRootElement(), init_gui) addEvent("showLoginGUI", true) addEventHandler("showLoginGui", getRootElement(), function() guiSetVisible(GUILogin.window[1], true) end) the last line : addEventHandler("showLoginGui", getRootElement(), function() guiSetVisible(GUILogin.window[1], true) end) i don't know what i must put in the second argument : getRootElement() or getResourceRootElement() or localPlayer
×
×
  • Create New...