Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. You can only use exports if they are not in a different resource. (correct me if I'm wrong!) and his scripts are in 1 resource.
  2. Why the hell,,, you want to set data to each player just to check if its a zombie or not? Zombies most likely have a skin, like the hobo one or something. If thats true in his situation, just let him check the skin and see if its a zombie or not. Way faster and a cleaner code. :3
  3. 1st: thanks for the fast reply 2nd: I know about that one, but that requires an event for every damn function. And I'm lazy 3rd: Won't that cause lag? I didn't mention, but the functions will possibly be used very often, so I want to make everything as resource efficient as possible. (like every half second but even more on big updates) ps.: also didn't mention: it's for an inventory script, if anyone can help with that, here will be a link: triggerEvent will cause lag if you use it multiply times. You can try to combine those scripts into 1 big script and just use them as a normal function; functionName(parameterOne, parameterTwo);
  4. You're Welcome . @ test local not Local ! haha soz, typo.
  5. Have you learned something from it? Cause this is kinda... first day of programming that people are learning you that this wont work; if true then What has to be true, what is true? Whats going on? O_O A true/false is a returned bool value. So if you got a function that returns a boolean you can get 2 things back; True or False. So lets make a little script with it; local pedInVehicle = isPedInVehicle(source); if (pedInVehicle) then -- if its true outputChatBox("In a car!", source); else outputChatBox("FALSE!, aint in a car brotha!", source); end Get it? (aint trying to be a btch or so, just want people to learn from their mistakes cause of my mistakes, I gained alot of knowledge)
  6. You just want to use 1 script into another script? You can try to use the triggerEvent function? n_n triggerEvent
  7. Can you describe it in a different way? 'Cause I dont get it.
  8. tosfera

    Help please

    Try reading this as a start; isVoiceEnabled
  9. Keep it simple; addCommandHandler("open", function(source) local playerName = getPlayerName(source); outputChatBox("* ".. playerName .." MESSAGE", source); end);
  10. Did you define the variable; thePlayer in the function? + you can use getRootElement() but its not completely used. You are using thePlayer as a name, so you can also change the getRootElement() to thePlayer or even to source. Cause the source of the event onPlayerJoin/onPlayerLogin = the player element.
  11. tosfera

    Help please

    Shutdown the killmessages and see if it still outputs it twice, if not. There will be a duplicated source running.
  12. If you want to output it for every player, just dont give a source in the outputChatBox; outputChatBox("*".. .. " joined the server, welcome!");
  13. What about your useful function? dxDrawGifImage I Think That's What He Want? Thats an image, thats possible to do. You're 100% right there, but solid said no 'cause of the 'video game'.
  14. clientContainer.GUI.root = guiCreateWindow(resX/2-300/2, resY/2-500.5/2, 300, 500.5, 'Log in', false) Thats the GUI you're creating, and the name of it. To set the window not moveable, you've to use the name of the window you created + you've to set it not moveable after you created it; ClientContainer.GUI.loginGui = guiCreateWindow(resX/2-300/2, resY/2-500.5/2, 300, 500.5, 'Login', false); guiWindowSetMovable(loginGui, false);
  15. tosfera

    2 servers

    There is, you can save them in a database and then connect them both to the same database. It wont be a problem then.
  16. Or do you mean that ped's can't walk when a gui is up? showCursor
  17. tosfera

    function

    Why do you want to create a function in another function, create it outside of it so you can call it back alot more. Thats called OOP (Object Orientated Programming). function Gui() guiSetVisible(guiwindow, false); bindKey("F2","down", showgui); showGui("guiwindow"); end function showGui (window) guiSetVisibile(window, true) end
  18. Try to refresh your resources. In the cmd of the server (The server console), type in: Refresh It will say that it found a new script and loaded it (un)successfully. After that you can start it
  19. tosfera

    [Tables]

    Making a table isn't that hard, all I know is that a table is the same as an array. The most usefull thing to do is in your situation is to create a double array (array in an array). skins = { { "skinid", "skin desc" } , { "skinid","skin desc" } }; Then use a loop to get all the skins, and a math.rand to start off with. After that, just bind the left and right button/arrow keys to make it go to the next index of the array.
  20. tosfera

    xml xml xml

    try this; jaildata = xmlLoadFile ( "jails.xml" ) if jaildata then jaildata = xmlFindChild ( jaildata, "Jail Data", 0 ) cur_jails = xmlFindChild ( jaildata, "Current Jails", 0 ) history = xmlFindChild ( jaildata, "History Jails", 0 ) xmlSaveFile(jaildata) else jaildata = xmlCreateFile ( "jails.xml", "Jail Data" ) cur_jails = xmlCreateChild ( jaildata, "Current Jails" ) history = xmlCreateChild ( jaildata, "History Jails" ) xmlSaveFile(jaildata) end 1. you didn't save it. 2. You spelled; "jaildat" in the first line if the xml file is loaded succesfully.
  21. Oef, didn't code for 3 days cause of this. :\ Maybe people dind't rly understand my question. So lets try again I'm starting a giant project thats going to communicate with a database, but to prevert lag I'd like to know wich database type is the best to use. The wiki is pointing you to 2 types of databases: * Sqlite * Sqlserver The thing about the sqlite server is that its just 1 file, but you can't look into it to check some values. Wich you can do in a sqlserver. Another thing as security is that its harder to rip the database of the server, but if they rip the file they can't see the values in it without lua knowledge and the table names. The thing I'm trying to find out right now is: Wich database type/service thing is the best to use comparing to the other one. Its going to be about 15/16 table's with alot of data in it. Maybe its alittle more clear now.
  22. Wauw, first one I see thats helping someone that might have leaked files.
  23. Ahh like that, you're now using the keys to look around? Cause in the GTA settings you can say that you want to move with your mouse.
  24. Kinda bothers me that your name is the same name as his youtube channel... (:
×
×
  • Create New...