-
Posts
1,031 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Bonsai
-
createdVehicle is local, so u cant use it in that second function. You have to declare it outside of any function. But you should probably store them in a table anyway. vehicles = {} vehicles[player] =
-
Well, thanks to everyone who tried to help me with this. Turned out I'm just a dummy. Serverside freeze, Clientside unfreeze. Bonsai
-
Come on peeps, someone gotta know how I can fix this.
-
You are some helpful people. local name = getPlayerName(source) local c1, c2 = string.find(name, '#%x%x%x%x%x%x') if c1 then r, g, b = getColorFromString(string.sub(name, c1, c2)) else blipr = 255 blipg = 255 blipb = 255 end createBlipAttachedTo ( source, 0, 2, r, g, b, 255, 0, 10000, root)
-
https://wiki.multitheftauto.com/wiki/OnPlayerChat messageType: An integer value representing the message type: 0: normal message 1: action message (/me) 2: team message if normal message and source = muted guy cancelEvent()
-
I wish it was so easy. But they definitively are.
-
Hey Guys, I got this situation: Two players are spawned. Two vehicles are spawned. Players are warped into the vehicles. They are in same dimension. But, if Player A specs Player B or the other way round it looks kinda laggy. They seem to slide over the ground. When they hit each other, there is no reaction. Like hitting a wall. I don't know what went wrong there. If someone saw this behavior before, please tell me how to fix that. Bonsai
-
Thanks Bro, I'll check that out. Suuure, I'm just interested
-
I know that, thanks anyway. But there are so many things that can be created by a script and you would have to create wrappers for any function. Thats why I came up with that onElementCreation idea. Also, an event that is triggered when something like time, gravity etc. is changed would be very useful. That way you could load a clientside script, those two events detect all changes made and when you want to unload it, you just gotta destroy the elements and change world stuff back to normal. Bonsai
-
It's not going to happen, stop attempting to copy other servers. Apparently you do not know what an element is. https://wiki.multitheftauto.com/wiki/Element I'm not attempting to copy anyone, why would I. This Board exists so people can post SUGGESTIONS. That's what I did. Why is everyone so hostile around here. Like people who search for more efficient solutions are completely insane.
-
Anyway, why isn't there an Event for Element Creation? That would help alot. I've only found https://wiki.multitheftauto.com/wiki/On ... entDestroy. onClientElementCreation or something like that would offer you the possibility to store created Elements easily and destroy them as soon as they are not needed anymore.
-
That function loads the map file for all players. A lot of work for many Scripters, a little work for MTA Team.
-
It just gotta be for free and there gotta be an option in server browser to hide colors. Then this would be a cool small easy to add feature.
-
Since more and more servers are switching over to some kind of arena system, there should be some built in function to support scripters. This could be e.g. a function to send map data to a certain element and it childs only. There also should be a way to attach client side loaded scripts to an element or something, so it can easily be destroyed without having to catch every called function. MTA already has such a system which is attched to resource stops, this just gotta be possible without an actual resource being stopped. Bons
-
Hey Guys, I've created a map with gamemode race. It uses Respawn but it's not a real race map. To make someone win the map I use setElementPosition to "teleport" that player to a checkpoint. That works pretty good but in my opinion its not a nice solution. I was wondering if there is any way to set someone as the winner of a map. Is there any Event that could be triggered or something? Would be really helpful because sometimes the winning player is not alive, so his position can't be set. Thats why I have to check if he is actually alive and then set a timer to call the same function again. I'm happy for any reply Bonsai
-
Thanks a lot. It works, finally. Now I can finally finish this confusing map Thanks.
-
I tried that now, I'm not sure if I did it correctly, but it didn't work. The Water was going down for everybody, not just for the MarkerHit Player. addEventHandler("onClientMarkerHit", grav1, function(element) if getElementType(element) == "player" then setTimer ( drainSomeWater, 100, 200, thePlayer==getLocalPlayer() ) end end ) function drainSomeWater(thePlayer) level = level - 0.03 setWaterLevel ( level ) destroyElement(grav1) end I can't believe that its so difficult to get it working
-
Of course But still doesn't work.
-
Okay, Another problem addEventHandler("onClientMarkerHit", grav3, function(element) if getElementType(element) == "player" then setTimer ( drainSomeWater, 100, 15000 ) end end ) function drainSomeWater() level = level - 0.03 setWaterLevel ( level ) destroyElement(grav3) end This works now. But it triggers for every Player. How can I make it just for the Player who hits the marker? Actually I know how to, but here, it doesnt work here. function drainSomeWater(thePlayer,dimension) if (dimension and thePlayer==getLocalPlayer()) level = level - 0.03 setWaterLevel ( level ) destroyElement(grav3) end end
-
Woopsi, just a misspelling
-
I know how that function words. Its just, I tried to do the same before I posted here. I created a function with a Timer in it, and set it to trigger on(Client)MarkerHit. addEventHandler("onMarkerHit", getRootElement(), functionWithTimerInIt) functionWithTimerInIt() setTimer ( drainSomeWater, 100, 15000) end And that did not work. But now, everything works fine using the other way Thx again.
-
addEventHandler("onMarkerHit", getRootElement(), function(element) if getElementType(element) == "player" then setTimer ( drainSomeWater, 100, 15000 ) end end ) Why does this function have to be in there? I tried to do the same by just putting the function's name in there, but it didn't work. So I'm a bit confused here.
-
I think you need a function for that. addEventHandler("onMarkerHit", getRootElement(), function(element) [b]if getElementType(element) == "player" then[/b] setTimer ( drainSomeWater, 100, 15000 ) end end ) Nice one, works perfect. I don't really understand why it has to look like this, but anyway, Works! Thanks
-
Hey all, I got another little problem, and I can't solve it by Wiki. I want a function to start its job, when a Player hits a marker. local level = 0 function drainSomeWater() level = level - 0.01 setWaterLevel ( level ) end setTimer ( drainSomeWater, 100, 15000 ) For example, that function triggered on Marker Hit. SetTimer is used here, to make the water go down slowly. So actually, I just need the Timer to start on Marker Hit. But I can't get it working. I hope someone understands the Problem, and knows how to fix it. Greetings