Jump to content

unknooooown

Members
  • Posts

    259
  • Joined

  • Last visited

Everything posted by unknooooown

  1. Don't mind CapY.. He is a little slow.. You are forgetting to define playerName anywhere in your script. You need: local playerName = getPlayerName(source) You also want to do is remove ' "" ' from "Staff" - So: -- This should be changed setPlayerTeam (source, "Staff") -- To this setPlayerTeam (source, Staff) And just before the end, I dont see a reason to use cancelEvent(), in your case, because if the user is not in the Staff group, then nothing will happen.
  2. Like this? if getElementData(lp,"Zombie kills") ~= <=100 then ' ~= <= ' You can't do that. Thats like saying: "If X is not the same as Y and X is less or the same as Y, then" But you are on the right track.
  3. @ AnDReJ98 - Doesn't look like it's possible to do what you want. Tbh, I am a bit surprised that there isn't a function for that in lua, since it exists in other languages. But I haven't been able to find a solution for your problem. CTRL+C is probably the only way.
  4. How are you gonna run the resource, to show the server is offline, if the server is offline? If you know about php scripting yourself, have a look at: https://wiki.multitheftauto.com/wiki/PHP_SDK I'm sure you can find a solution for your problem. I dont know anything about php or the PHP_SDK, but shoud be possible to create something that detects when the server is online/offline. Most of it would probably have to be run on your site. Again, I am not sure about this. I am only guessing and trying to help you
  5. 1. I dont know, ill fix it now. 2. I know how to do onPlayerQuit, its the saving bit I dont know how to do. -PS, the zombie kill count now saves? I must of tested it wrong. But I still need help with the first question -PS Never mind, i fixed both, thanks all! Try using the code, that you know works, from the previous topic. If it worked at some point, it still has to work Look through your code. Must be something you have created AFTER adding the greenzone code thats causing a problem.
  6. http://lua-users.org/wiki/TableLibraryTutorial
  7. What is it with you and tortoiseSVN? I don't know why you would be using that? All you need is: viewtopic.php?f=108&t=30494 http://code.google.com/p/hedit/downloads/list + Your eyes and the ability to read. About the key to open hedit: Is it B or K thats bound to hedit by default? B
  8. You could do something like: gui["pushButton1"] = guiCreateButton(20, 95, 150, 23, "button", false, gui["_root"]) gui["pushButton2"] = guiCreateButton(40, 95, 150, 23, "button", false, gui["_root"]) gui["pushButton3"] = guiCreateButton(60, 95, 150, 23, "button", false, gui["_root"]) gui["pushButton4"] = guiCreateButton(80, 95, 150, 23, "button", false, gui["_root"]) addEventHandler("onClientGUIClick", gui["pushButton1"], func1, false) addEventHandler("onClientGUIClick", gui["pushButton2"], func2, false) addEventHandler("onClientGUIClick", gui["pushButton3"], func3, false) addEventHandler("onClientGUIClick", gui["pushButton4"], func4, false) function func1() outputChatBox("Pressed pushButton1 and triggered function func1") end -- function func2() outputChatBox("Pressed pushButton2 and triggered function func2") end -- function func3() outputChatBox("Pressed pushButton3 and triggered function func3") end -- function func4() outputChatBox("Pressed pushButton4 and triggered function func4") end Again, this is just to show you how it can be done. This isnt the best way of doing it ( I would never do it like this for a script. ), but it can give you an idea of how you should do it yourself. UPDATE. Just wanted to add a more clean way of detecting the buttons. gui["pushButton1"] = guiCreateButton(20, 95, 150, 23, "button", false, gui["_root"]) addEventHandler("onClientGUIClick",root, detectBtn, false) -- In this function you can add all the if checks you want. Doesnt matter if there is one or 1000000 buttons in there : - P function detectBtn() if source == gui["pushButton1"] then outputChatBox("Button pressed") end end NOTE: When using onClientGUIClick: The source of this event is the GUI element that was clicked.
  9. Question 1. function greenzoneExit ( thePlayer, matchingDimension, player) Why do you use 'thePlayer' and 'player' as arguments? Question 2. function quitPlayer ( quitType ) --save data nao! -- kthxbai end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) https://wiki.multitheftauto.com/wiki/OnPlayerQuit
  10. You wouldnt have to use 15 different gui's I know that it would seem like the most logic solution, but there is a way around that function openCustomGui(msg) local gui = {} gui._placeHolders = {} local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 200, 131 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 gui["_root"] = guiCreateWindow(left, top, windowWidth, windowHeight, msg, false) guiWindowSetSizable(gui["_root"], false) gui["pushButton"] = guiCreateButton(20, 95, 150, 23, "button", false, gui["_root"]) --addEventHandler("onClientGUIClick", gui["pushButton"], closeWindow, false) gui["label"] = guiCreateLabel(15, 27, 171, 61, "textToDisplay", false, gui["_root"]) guiLabelSetHorizontalAlign(gui["label"], "center", false) guiLabelSetVerticalAlign(gui["label"], "center") return gui, windowWidth, windowHeight end This function will be called every time you use 'openCustomGui(argument) Look at the code below for an example. function setCustomGuiTextMessage() randomMsg = 0 for i=1,15 do randomMsg = randomMsg + 1 openCustomGui(randomMsg) end end addCommandHandler("setCustomGuiTextMessage",setCustomGuiTextMessage) This result would make the GUI trigger 15 times, with a new message, in this case just a number, for every time the window is opened. From 1-15. Like this, we dont have to create many differeny guis for each message. As long as we know there is room for the message, we are good to go! If I were to change for i=1,15 do to for i=1,15000 do , then 15000 new windows would be opened, but we still only have ONE main window that we needed to create. Tell me if it makes sense to you
  11. There are a lot of different ways of doing this. Do you want it to be pure text, do you want a gui for it or something else? Give some more details on what your idea is and I will try to explain how you can make it. You are gonna have to script it yourself, but I don't mind pointing you in the right direction.
  12. https://wiki.multitheftauto.com/wiki/CreateMarker Where do you think you should go from here?
  13. Yeah, you are right about the enemy bullets. I think that I am gonna make a different color for each type of enemy. Atm there are only "runners" and "normal" peds.. But I will work on adding others. Different backgrounds is a great idea. Could use a random one for each level. Powerups will also be added today! - I am probably gonna use all of your suggestions + whatever I can think of during the day. Haha thats great! If moving up and down is enabled, maybe a powerup to make barrels, walls and mines. Barrels blow up once hit, walls take 4 hits and mines blow uup 3 secs after being stepped on. You should make enemies hit walls if they encounter one Yep! I was also thinking about adding "up/down" movement. Wouldnt take more than a few mins to add to the existing move handler. Also gonna add the walls/shields you are talking about. Easy to add with all the objects of the game! Just need to find the correct objects, so I dont create a piece of solid ground as a wall Mines is also something I am have to think about adding! - Would be fun to add a "helper" as a pickup. Could be one of the RC vehicles that flies/drives around for x number of seconds and helps the player.
  14. Yeah, you are right about the enemy bullets. I think that I am gonna make a different color for each type of enemy. Atm there are only "runners" and "normal" peds.. But I will work on adding others. Different backgrounds is a great idea. Could use a random one for each level. Powerups will also be added today! - I am probably gonna use all of your suggestions + whatever I can think of during the day.
  15. Yeah, I agree. I am gonna rewrite that part of the resource today, so its more controlled. Much of the enemy control is VERY random atm. Probably also gonna add levels, so the game increase in difficulty as the level increases.
  16. Thank you John_Michael Glad you like it Update! Changes Entire resoure rewritten. Much better structure and cleaner code. Changed firing mode from Press,Release,Shoot to Press,Hold,Shoot,Shoot,Shoot... Changed move to smoothly(kinda) move the player across the screen when arrow_r or arrow_l is pressed. To do list Create new custom sounds. Update menu. Add reward drops from killed peds. - Example: health, armor, bigger shots, extra points, speed boost, shield.. etc. etc. ..And much more!
  17. See this example. This is one way of saving the skin, for the next time the player connects. function onMapLoad () -- create our table, if it doesn't already exist executeSQLCreateTable ( "players", "clothes_head_texture TEXT, clothes_head_model TEXT, player TEXT" ) end addEventHandler ( "onGamemodeMapStart", getRootElement(), onMapLoad ) function addInfoToSQL( theSpawnpoint, theTeam ) sourcename = getPlayerName ( source ) -- get the player's name -- try to retrieve the player data from the db result = executeSQLSelect ( "players", "player", "player = '" .. sourcename .. "'" ) if ( result == false ) then -- see if any data was found at all outputChatBox ( "This is your first time here! Welcome " .. sourcename .. "!", source ) executeSQLInsert ( "players", "'none', 'none', '" .. sourcename .. "'" ) else outputChatBox ( "Welcome back " .. sourcename .. "!", source ) executeSQLUpdate ( "players", "clothes_head_texture = 'hairgreen', clothes_head_model = 'somehead'", "player = '" .. sourcename .. "'" ) end -- get the clothes data for the player result = executeSQLSelect ( "players", "clothes_head_texture, clothes_head_model", "player = '" .. sourcename .. "'" ) outputChatBox ( "Your head texture is " .. result[1][1] ) outputChatBox ( "Your head model is " .. result[1][2] ) end addEventHandler ( "onPlayerSpawn", getRootElement(), addInfoToSQL ) https://wiki.multitheftauto.com/wiki/ExecuteSQLUpdate And for getting the players current skin use. https://wiki.multitheftauto.com/wiki/GetElementModel
  18. There is a bug in it... Didnt notice before I compiled it. I'll fix it later
  19. And what's that supposted to mean ? Nice one 50p. Look through your posts and see how many times you write: "No/Yes.. Blah blah blah.. But remember to do X, because I can't make it work any other way." Seriously dude.. If you feel that you can help people, thats just great and please do so! But if the only advise you can give is what you THINK works and your own hacks to make things work.. Well.. People cant really use that, as its most likely not the correct way of doing it even if it works atm. I am not the only person that have noticed this CapY.. I guess that I am just the only one confronting you about it. Write me in private.. Dont wanna go anymore offtopic that we already are.
  20. No, use LUA. @Wafamande you're doing that right now. I just gaved him advice. You didn't give him advise. You just gave him some wrong info, like you do most of the time. At least try to Google your "advise" before posting it. Its wrong 80% of the time.
  21. That doesnt answer his questions in any way. Why do you bother posting answers CapY? You never really reply to questions..
  22. @Benxamix2 (The Kid) - I will probably have a look at it. Not sure if I will use any of it, but looking never hurts. Just wanted to let everyone know that I have not forgot about this project. I just need a break after looking at the same code for 4-5 months now. 12/4/2011 Project is still alive!
×
×
  • Create New...