Gamesnert
MTA Contributors-
Posts
2,035 -
Joined
-
Last visited
Everything posted by Gamesnert
-
How long did you wait? I know it says "Loading..." sometimes and it takes VERY VERY VERY VERY VERY long sometimes... But if you wait they'll come I think...
-
... A.... Little bit more info would help?
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
setTimer is usable in several ways: Normal way: setTimer(,,,) Scripting command way: setTimer(setElementPosition,,,player,0,0,3) Alternate way: setTimer(function() end,,) And Ace: I did do that, the module also is added, everything like explained, but just doesn't detect it. EDIT: Event "onPlayerWasted", works exactly like "onPlayerJoin". Except for a few optional parameters you should ignore. Try it with this info EDIT2: * added. *=in miliseconds (30 minutes = 60000*30 miliseconds = 1800000 miliseconds. ) -
You might be able to make empty rows, and make some labels over them. Also, see this function for more info: http://development.mtasa.com/index.php? ... elSetColor
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
56 you mean? And still 56 is nothing. I have a small mission script of over 84 lines which isn't done yet, and another of 83 (coincidence? ) which is. And I didn't remember why source didn't work. So I didn't tell him, no. ^^ And to avoid this, I already edited a small part of the introduction for further explanation. (didn't delete anything, only add a few things) So anyone new shouldn't do this, or they proof they didn't read well. ^^ New message in the meantime, so I'll answer immediately: Well, if you look at your joincode, I'm not surprised. Or do you mean something else? EDIT: Forgot my even bigger missions, 128 client-side, 125 server-side... ^^ -
So you want the entire HUD replaced by the GUI? Clever. Anyway, it would be no clock disappear untill DP3. This apparently has been confirmed by Ransom: Source: LINK EDIT: Just in case you didn't know, I was talking about the first line ^^
-
No, what I'm saying is that it's just done by GTA or MTA, not by a command! Searching for the command used... Good luck!
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
How come? I prefer MySQL because the SQLite implementation is too basic for my likings and XML just sucks for dynamic data management. +1 Well, the problem was that my MTA doesn't detect the modules. I would actually have agreed that MySQL would have been better! But well, if it doesn't work... Well back on topic: Answer: No. The reason for that is that you are fading the camera of the RESOURCE. Source means who/what triggered an event. This means you also shouldn't add source as an argument name in function ...(). How to solve this is simple: change addEventHandler into event "onPlayerJoin" and the 2nd parameter to getRootElement(). These errors are easy to solve: For the first script: Both "setElementPosition" and "outputChatBox" contain bad arguments! Which? Player should be source. For the second one: As I stated earlier: It's NEVER an good idea to do "function ... (source...)". Source is something you should avoid making custom. (made the same mistake in the beginning ) So remove all of the "source" parameters in the entire 2nd script, and replace them all with "player". Always keep in mind: Source is used by addEventHandler as a variable that shows who/what triggered the event! ALWAYS! -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
C00L! Can you help me making a /savepos command? I tried to but the best i could was function savePosition ( source, commandName ) local playerPos = getElementPosition ( player ) local hFile = fileOpen("savedpositions.txt", false) if hFile then fileWrite(hFile, "Coordinates: " .. playerPos ) fileClose(hFile) end addCommandHandler ( "savepos", savePosition ) function makePositionFile ( source, commandName ) local newFile = fileCreate("savedpositions.txt") if newFile then fileClose(newFile) end addCommandHandler ( "makeposfile", makePositionFile ) but i think something is wrong in there Well g2g and sleep now, but i'll check your answer tomorrow (If you answered! 666 ) I would really recommend XML or (My)SQL for this. But SQL is a bit difficult and MySQL modules were failed for me. So I recommend XML instead of .txt's. So it should be something like: (have a good look at the lines with -- ! and compare with your script) function savePosition(player) -- ! local x,y,z=getElementPosition(player) local xmlFile=xmlLoadFile("savedpositions.xml") or false if xmlFile==false then -- ! xmlFile=xmlCreateFile("savedpositions.xml","positions") xmlFile=xmlLoadFile("savedpositions.xml") or false end if xmlFile then local playerNode=xmlFindSubNode(xmlFile,getClientName(player),0) or false -- ! if not playerNode then playerNode=xmlCreateSubNode(xmlFile,getClientName(player)) playerNode=xmlFindSubNode(xmlFile,getClientName(player),0) or false -- ! end if playerNode then local success=xmlNodeSetAttribute(playerNode,"x",x) -- ! xmlNodeSetAttribute(playerNode,"y",y) xmlNodeSetAttribute(playerNode,"z",z) if success then outputChatBox("Position saved!",player,0,255,0) -- ! end end end end Now it's the best that you read both the wiki and the script I gave you (untested!) to make a load version. A little note: you might see: "or false" sometimes. Don't think: "Huh?", because this has a reason. If it does not succeed, I never like errors. I usually set up my own errors. ^^ Didn't do it now, (almost bedtime for me too) but I can add it later on. If you still want to see if there are error messages in the meantime, remove "or false". P.S. 50P was first You might want to try his code aswell since he's a more talented and experienced scripter than I am. EDIT: By the way, didn't he mean saving positions of players..? -
In EVERY gamemode the clock is disabled while idling for a while.
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
13 years old is no excuse. I'm really only a year older! ^^ Anyway, tables are like variables, but they can store more at a time. It's handy to use tables because you can make tables on top of your script, allowing users to edit it easily when you put it in the resources list. Or, you can do something like table destroyedVehicles, and that if you do destroyedVehicles[aVehicleElement], it'll check if it's present. If it is, it's destroyed. If it isn't, well guess. ^^ Tables aren't necessary in the beginning. But later on, you'll see the importance of knowing how to use them. That's why I recommend you to already learn XML and tables, so you don't have to right when you need them. EDIT: I just edited the xmlNodeGetValue and xmlNodeSetValue pages, so they might be a little different seen the documentation. But otherwise you looked at a lot of "blah"... ^^ -
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
Good! Work some more on it and you can post it in the resources list. You might want to learn how XML and tables work if you make them public: XML: HERE Tables: HERE and HERE If you want to keep it for yourself, I still recommend you look at them. (especially tables!) -
Well, actually I already said this in a previous topic of yours. But I think you indeed might need to. lol ^^
-
onClientPlayerDamage onPlayerDamage 2 events 1 server-side, 1 client-side 1 simple solution Anyway, so add something like this: function updateHealth() guiGridListSetItemText ( HealthStat, 2, 1, "Your current Health: " .. getElementHealth(getLocalPlayer()), false, false ) end Don't forget to add the addEventHandler in clientsideResourceStart function!
-
RP Game Mode Help/Progress topic "RPG Server (ALPHA STAGE)"
Gamesnert replied to Michael_Sund's topic in Scripting
I think so: source==nil. Why? OnPlayerJoin has NO PARAMETERS! Still, you did list source, commandName. But they'll just be nil. (for as far as I know...) Solution? Remove source,commandName in line 1. -
Might be because it isn't solid?
-
viewtopic.php?f=89&t=23364
-
I might edit some examples soon, a bit busy at the moment though...
-
T is the chat button. You could have found it in the wiki, Deathmatch Client Manual.
-
I did, but didn't understand a single thing about it... =/ Anyway, thanks. Going to try it as soon as possible. EDIT: Hmmm... The gates fly away... Maybe because x and y aren't in the calculations? EDIT2: Solved! For opening, I use: local newX = x+math.cos (math.rad(rz))*distance local newY = y+math.sin (math.rad(rz))*distance While closing needs: local newX = x-math.cos (math.rad(rz))*distance local newY = y-math.sin (math.rad(rz))*distance I know for sure I'll get sin, cos and tan the after the holliday or next year in school, so untill then I'll read and try to understand the wiki... *Sigh*...
-
In onClientPlayerDamage http://development.mtasa.com/index.php? ... ayerDamage guiSetText(element,getElementHealth(getLocalPlayer()) --Don't forget to change element! -------- Or something like that. And ofcourse some of the other events which include respawn etc.
-
Since I script for VNRP most of the time now, I now got in touch with gatemoving codes, and made a small GUI for it. But it's not effective, It can only know where to go to if I know it... What I mean is for example if I want a gate to be moved about 4 meters, if I want it to the right, I do x+4 (just to make it easier to understand). To the left x-4, up y+4 down y-4. But how do I let a script calculate where it should end if it's for example rotZ=236 and I want it to be moved 5 coordinates to the right? Then it's X AND Y axis would change... How can I calculate this? Thanks in advance, Gamesnert.
-
We might need to check line 4!
-
The worse you are, the more I recommend you to script. Makes you buildup experience.
-
Looks pretty good! I'll test it soon
