-
Posts
2,318 -
Joined
-
Last visited
Everything posted by lil Toady
-
change nick on nick change and dont get into infinite loop
lil Toady replied to dzek (varez)'s topic in Scripting
remove the event handler when changing the nick function onPlayerChangeNick ( old, new ) removeEventHandler ( "onPlayerChangeNick", getRootElement(), onPlayerChangeNick ) setPlayerName ( source, "something" ) addEventHandler ( "onPlayerChangeNick", getRootElement(), onPlayerChangeNick ) end addEventHandler ( "onPlayerChangeNick", getRootElement(), onPlayerChangeNick ) yeah, looks a bit ugly but thats gonna work. Could as well hook that code into setPlayerName function so no call to it in the script triggers the event -
Chatbox is really possible, i have a scripted dx chatbox, which works exactly like the mta's one and has the same options aswell + has tabs on the side you can switch. I agree, making the input was a bit hacky but possible, commands get executed with executeCommandHandler and binds are blocked with guiSetInputEnabled functions.
-
Strange it hasnt passed the vehicles you dont see. But anyway. You could drop the loop at all and instead shoot a process line of sight in the direction the player is facing for the distance you want. local x, y, z = getElementPosition ( player ) local rot = getPedRotation ( player ) local radius = 4 local lx = x + math.sin ( math.rad ( -rot ) ) * radius local ly = y + math.cos ( math.rad ( -rot ) ) * radius local hit, hx, hy, hy, element = processLineOfSight ( x, y, z, lx, ly, z ) if ( hit and getElementType ( element ) = "vehicle" ) then -- 'element' is the vehicle you need end
-
You dont need all the fancy server-client event calls, just get the closest vehicles looping through all of them (getElementsByType("vehicle")) and comparing distance between the vehicle and local player(getDistanceBetweenPoints3D), if its close, check if its on screen.
-
I guess isElementOnScreen would be useful for you to find out if a player is facing some element. As for the limits, there is an overall limit for the number of elements (vehicles, objects, peds, etc. all together) but i doubt you will ever reach this limit as its over 65000 elements. But there are also some other limits like number of objects in one area (cant remember the numbers) and a number of vehicle models in one area (if i remember right it was about 120 different models, but you are not limited in number of vehicles as long as the number of models does not get over this limit). So practically you are free to have as many elements as you want as long as they are spread over the map well.
-
Does your system show file extensions? It could be that you saved your file as music-somethinggood.lua.txt for example. You could try to open the file with notepad, then in "save as.." make sure you have "any file type" selected instead of "text file"
-
I dont see what you are trying to do, mta already handles streaming with position and all the states etc
-
Are you sure they could not gain admin access somehow? Or maybe some way to login onto your server ftp? Admin resource logs all the actions done with it, would probably be useful to check the server log file as well
-
If i got what you want right you have two solutions for that: 1. function remoteCallback(...) local arguments = { ... } end here you can access your args in the arguments table like arguments[1], arguments[2], etc. 2. Just pass your stuff in a table, json can cope with tables
-
Thats pretty much scriptable, you could open a service on your server's http port where people would login with their mta account and upload their texture. So in game when they draw spray tags it creates their textures there
-
Registration is not required at this point, you can play without it just fine. P.S. Welcome!
-
+ Zerbian and norby89 and maybe a few more coming soon
-
The hitPlayer variable is either not a player/ped or is not set at all
-
Contact me via a private message here or at our irc channel
-
robhol, instead of whining you should stay on topic or be silent. Thanks. MasterTobi, varez, is right, please keep it english, there might be other people your post could be useful to. On topic: Would be useful if you provide the whole part of your script, where you set the variables you use here. Do you get any errors in debugscript? And why not do the whole part server side?
-
What version of mta have you got? You probably have to get the latest one. And make sure you can access http://www.game-monitor.com
-
Oh noes, you couldnt express your orangeness in your nick! You aint orange! Traitor!
-
You think you're the real and the only orange fan? Then this community is for you! Show your orangeness in your nick and you're in! Everyone is welcome! Current Members: ¤ lil_Toady (lil_Orange) ¤ Ransom (Orangesom) ¤ Talidan (dantheorangeman) ¤ BrophY (Brorange) ¤ Iggy (orangy) ¤ norby89 (norange89) ¤ aru (arunge) ¤ Slothman (Slorangeman) ¤ Zerbian (Orangebian) ¤ BB101 (Orange101) ¤ Sebihunter (Orangehunter) ¤ Madis (Morangedis) ¤ robhol (roborange) ¤ NeonBlack (Neorange) ¤ Mr.Hankey (Mr.Orange) ¤ MCvarial (MCorange) ¤ Tjong (Tjorange) ¤ Jyrno42 (Orange42) ¤ Nicholas (Nichorange) ¤ Buffalo (orangeBuffalo) ¤ Jason_Gregory (Jorange_Gregory) ¤ DarkDragon (dragorange)
-
boo! Well, actually gui supports cyrillic, but only with a small scripting hack at this moment (it was somewhere on the forum). Both cegui and lua support unicode, thats just mta that makes it harder to use atm.
-
With mta scripts you could connect a couple of mta servers together. You can sync chat/kills/anything between servers and throw players from one server to another with redirectPlayer (location dependant?). Making them work together i would think it'd be much more efficient than having everyone on one server, if done well.
-
'fps_limit = 35' in console should do the trick aswell
-
8800 Sapphire Arte!
-
http://www.lua.org/manual/5.1/manual.html#pdf-next
