Gamesnert
MTA Contributors-
Posts
2,035 -
Joined
-
Last visited
Everything posted by Gamesnert
-
First: I would like to recommend you to change getRootElement() in the event handler to getLocalPlayer(). Second: Wouldn't a table and a loop be better than so many lines? Third: >
-
Good, let's see if it'll speed it up a little.
-
Eh... Why would we help you if we get things like that back anyway?
-
Reminds me of another bug: X, Y and Z returning #QNAN or something and the entire screen looking like that sky... Still pretty weird though.
-
Lol! Just take the 32x32 version and stretch it from here to dunnowhere...
-
I would still recommend to convert all your pictures to PNG, GIF or JPEG files. Depending on the amount of colors. Low amount? GIF. Middle? PNG. High amount? JP(E)G. BMP sucks space and bandwidth for as far as I know... =/ And didn't see that it was an event... And login via SSH... Never heard of SSH...
-
I would SERIOUSLY recommend to use events... Some that may help: -onClientPlayerWeaponFire -onClientPlayerWeaponSwitch -onClientPlayerWasted With those events, do this: -onClientPlayerWeaponFire: Let it recheck ammo. Or, just let the ammo number go -1. -onClientPlayerWeaponSwitch: Swap code to check everything. If you can make your images .png, they'll be smaller by the way! -onClientPlayerWasted: Let it go on fist, with no ammo. You might need something else for admin panel or freeroam give weapon function. I'll think what will help. EDIT: Ace's performance suggestion would also speed it up dramatically! Make them invisible and on the same position. Then, make the one that you need visible. Good idea or no?
-
... A 0-28? Never heard of that one... http://development.mtasa.com/index.php? ... sues_-_FAQ might help..?
-
--element triggerFor: Do we need it? I think so, you don't want to trigger it for everyone I guess! --string name: That'd be "onHit" --element theElement: The source of the event. It's necessary! This is so you can call source in your function after the event. If it doesn't apply, use getRootElement(), but I would use MyMarker. Only a suggestion though. --arguments: This is if you have extra arguments to your script. Works the same as the parameters for any other event. ... I persume triggerFor might help? If you create a GUI for that 1 player, it'll only show up for him by the way. And I don't understand your 2nd question... What I do see, is that... The code is a little... unusual... Nah I think I know what you mean now and I'm going to explain what's wrong with your script. If we take a look at line 5, we see the function puts the element that triggered the event in cargoTrailer. But, cargoTrailer was already assigned to the trailer! Which means that a NEW cargoTrailer variable is being created, a local one. This would mean that, even if the object is your own truck you're in, if you destroy cargoTrailer, it'll destroy your truck. Might sound a little difficult, but later you'll see what I mean. Now we move on to line 6. We see something different going on! Think about you being in a truck, and your truck hits the marker. local cargoTrailer will get the element of your truck. Now we look at line six: if cargoTrailer == FinishMarker then In the case of my example, that would become: if [your truck] == [the finish marker] then So I think you see what I mean? These are the biggest errors I found. I think this might solve the problem: local cargoTrailer = createVehicle ( 584, -2244.660, -2569.4152, 33.003, 0, 0, 75 ) local FinishMarker = createMarker ( -56.6132, -1135.7636, 1.0781, "cylinder", 2.0, 0, 255, 0, 150 ) function TruckMarkerHit ( dontPutAnExistingVariableHereItsConfusingXD, mathcingDimension ) if dontPutAnExistingVariableHereItsConfusingXD == FinishMarker then destroyElement ( dontPutAnExistingVariableHereItsConfusingXD ) end end addEventHandler ( "onMarkerHit", FinishMarker, TruckMarkerHit )
-
Ok, I'll explain: triggerClientEvent ( "onHit", .... ) -- something there but i dont know what.. ? If we get the wiki page, we can see in the Syntax part: --element triggerFor: Do we need it? I think so, you don't want to trigger it for everyone I guess! --string name: That'd be "onHit" --element theElement: The source of the event. It's necessary! This is so you can call source in your function after the event. If it doesn't apply, use getRootElement(), but I would use MyMarker. Only a suggestion though. --arguments: This is if you have extra arguments to your script. Works the same as the parameters for any other event. Hope it helps P.S. If you need more info or an example, I recommend you to read the triggerClientEvent article.
-
and..what you mean ? The event is only triggered if player TruckMarker triggers the event. (aka, not the marker there, but the PLAYER )
-
do you store in a table them write the table to sql ? before the server shutsdown and load it in to a table when the server starts? No SQL, only XML. I just use my own save/load engine. It only costs 0.5 secs at start and 0.5 secs at stop. Then you have lag-free limitless editable XML saving! ^^
-
You're one step in front of me! ^^ But if that would have been the real problem why it didn't trigger, he would get an error. See my post. ^^
-
1.1.2? http://www.mtasa.com/race.html
-
XML works fine and lagless for me! (it only reads & writes at the start & end, the rest is just tablework. And it's easy to edit ^^)
-
http://development.mtasa.com/index.php? ... rMarkerHit "The source of this event is the player that hit the marker." ... addEventHandler ( "onPlayerMarkerHit", [b]TruckMarker[/b], HitMarker ) ...
-
Some downloads have this sometimes. Press the link saying "Download the latest version". Helped for me for the first few downloads.
-
There were some graphics options for MTA. Try disabling them?
-
Server console is for all OS' for as far as I know. However client isn't. And I doubt it'll change very soon. DP3 will come out first, and maybe later other OS' may support MTA.
-
Show us the content of the map file then.
-
This one isn't that difficult, it's just a tricky thing to discover. addEventHandler only works if it's BEHIND your created function. Why DOES addEventHandler("something", anything, function () blah end ) work? It CONTAINS the function instead of the one created earlier. All a big puzzle! Logically, it works the same as variables: If you do: if hello==1 then ... end hello=1 Instead of: hello=1 if hello==1 then ... end It no work... ^^
-
I'm pretty sure I know why: It loops, but does not detect when to stop except if the node is found it needs. If it doesn't find the correct node, it'll give an error. EDIT: Hmmm... Didn't read well... Gotta read a bit better... =/ EDIT2: I see it! (I think =/) It's in these lines: local count = 0 local account = xmlFindSubNode(xml,"account",count) local name = getClientName(source) 3 lines, entirely different. Except for 1 point: A word you should avoid using if you want it to work with loops: ... The only word all 3 lines have!
-
Yup. Google it.
-
That function is used in the race gamemode (MTASA DM). Oh... =/
