
Gamesnert
MTA Contributors-
Posts
2,035 -
Joined
-
Last visited
Everything posted by Gamesnert
-
I also notice you're forgetting 2 camera related things: - Camera is faded to black by default - Camera isn't aiming at the player by default To fix the above 2 "problems", use: fadeCamera(thePlayer,true) -- The player can see now, but it's kind of in a useless spot setCameraTarget(thePlayer,thePlayer) -- The camera is now following the player, which is a lot more useful
-
rootElement = getRootElement () players = getElementsByType("player") -- <---- function startMap( startedMap ) mapRoot = getResourceRootElement( startedMap ) triggerEvent ( "PlayerSpawn", rootElement, players ) -- <---- end Note how you're sending a table of players to a function that will only accept a single player argument. spawnPlayer simply doesn't like this, and when scripting functions don't like something, they won't give you the desired results. To fix this we need to split the table and trigger the event for every player. Much like: for index, player in ipairs(players) do -- For every entry in indexed table "players", store the index in variable "index", and the value in variable "player" triggerEvent ( "PlayerSpawn", rootElement, player ) -- Trigger event "PlayerSpawn" with source "rootElement" and 1st argument is the value of variable "player" end -- End of the code that has to be executed for every entry Note: You can remove the "--" and the text behind it, however leaving them there causes no harm. They're comments, and Lua will just skip these when the script executes. I hope that'll fix it for you.
-
Best bet is to use the client-side variant, yes. function getAllPlayerWeapons(player) local table = {} for i=0,13 do local weapon = getPlayerWeapon(player,i) if weapon and getPlayerTotalAmmo(player,i) ~= 0 then table[#table+1] = weapon end end return table end local myWeapons = getAllPlayerWeapons(getLocalPlayer()) Not tested, but I think this should work.
-
Eh, place all functions in the same function perhaps? And are you sure all necessary files are added to the meta.xml?
-
I doubt that... eh... "very useful post" will change anything about that, really.
-
-- Before: setCameraMode(player,"fixed") setCameraPosition(player,0,0,0) setCameraLookAt(player,5,0,0) -- Now: setCameraMatrix(player,0,0,0,5,0,0) -- Before: setCameraMode(player,"player") -- Now: setCameraTarget(player,player) I hope it's a bit clearer now. Otherwise, just check the wiki pages and try to figure out how it works, it's really simple.
-
setCameraMode + setCameraPosition + setCameraLookAt -> setCameraMatrix + setCameraTarget (for setting the camera to player mode again) For the other 2 errors we need to see the script itself to help you with it.
-
Kind of an unrelated question but, why would you want to kick players because they have a gamepad?
-
Kind of an unrelated question but, why would you want to kick players because they have a gamepad?
-
The changelist of DP2.3 -> 1.0 is quite a big one, it's kind of hard to give you all of the info you need. Your best chance would be to extensively debug the script, see at what part it stops and why. If you do know where the problem is, but don't know how to fix it, you can ask it right here on the forums. (or this topic, even)
-
The changelist of DP2.3 -> 1.0 is quite a big one, it's kind of hard to give you all of the info you need. Your best chance would be to extensively debug the script, see at what part it stops and why. If you do know where the problem is, but don't know how to fix it, you can ask it right here on the forums. (or this topic, even)
-
You can bind all controls to a function which checks how long ago it has been since the last time the player has pushed a button. If this has been over a certain amount of time (for instance 5 minutes) then you could kick the guy. The detection is best done client-side because of accuracy, but you can also place the checks server-side. (although limited) - Control names - bindKey - onClientRender - getTickCount You can check with onClientRender + getTickCount or setTimer how long it has been since the last control was pressed. ------------------ Alternatively, you could of course check if the player position has changed. Should basically require the same procedure, but a little different.
-
You can bind all controls to a function which checks how long ago it has been since the last time the player has pushed a button. If this has been over a certain amount of time (for instance 5 minutes) then you could kick the guy. The detection is best done client-side because of accuracy, but you can also place the checks server-side. (although limited) - Control names - bindKey - onClientRender - getTickCount You can check with onClientRender + getTickCount or setTimer how long it has been since the last control was pressed. ------------------ Alternatively, you could of course check if the player position has changed. Should basically require the same procedure, but a little different.
-
If you really meant so, it would be a good idea to actually write what you mean, and not something in 1 line which doesn't describe your meaning all that well. Also, where do I "quote your post negatively"? All I did was stating my very opinion. If I offended you with it, well, didn't mean to. But I can't see with what I would have offended you. And you know what doesn't make any sense? Starting a discussion and then saying "anyway i dont want to go into discussion".
-
If you really meant so, it would be a good idea to actually write what you mean, and not something in 1 line which doesn't describe your meaning all that well. Also, where do I "quote your post negatively"? All I did was stating my very opinion. If I offended you with it, well, didn't mean to. But I can't see with what I would have offended you. And you know what doesn't make any sense? Starting a discussion and then saying "anyway i dont want to go into discussion".
-
Frankly, I doubt anyone cares. Especially now that it has been over 3 months ago since the last post in this thread.
-
Frankly, I doubt anyone cares. Especially now that it has been over 3 months ago since the last post in this thread.
-
If I remember correctly, it will indeed take 2 entire hours. In my opinion, setWeatherBlended needs a time argument. (I think it's already reported at the bugtracker)
-
If I remember correctly, it will indeed take 2 entire hours. In my opinion, setWeatherBlended needs a time argument. (I think it's already reported at the bugtracker)
-
Did you make yourself an admin? Did you login? Did you make sure you're using an up-to-date version of the admin panel?
-
Did you make yourself an admin? Did you login? Did you make sure you're using an up-to-date version of the admin panel?
-
My opinion: If you want to go AFK, type /disconnect, /quit or just live with being killed. There's no point in being on a server if you're not playing anyway. The only reason you would have is that the server might be full if you disconnect and when you return you can't join because the server is full. But in MTA there's barely ANY server that EVER manages to get full. And if you do see another reason to stay AFK on a server, don't complain. If you're getting killed over 9000 times because you were having dinner, or were watching TV or anything, it's your problem, not that of others. Alternatively, servers can script stuff for AFK players. Like: - If the main menu is active, cancel damage ( isMainMenuActive() ) - Put AFK players in some remote place with quiet and peaceful background music (for instance St. Marco's Bistro) - Freeze AFK players and their vehicles, and unfreeze when they get back - Kill AFK players in race to make sure others can continue - Simply kick AFK players Conclusion: MTA is just way too flexible for a default pause option. Some gamemodes simply wouldn't work if the main menu would pause the game. Also, scripters have a wide variety of things they can do to solve this problem themselves, so this really should just be left to the servers / gamemode scripters to solve, not MTA in general. So again, either quit when going AFK, or live with being killed or whatever.
-
My opinion: If you want to go AFK, type /disconnect, /quit or just live with being killed. There's no point in being on a server if you're not playing anyway. The only reason you would have is that the server might be full if you disconnect and when you return you can't join because the server is full. But in MTA there's barely ANY server that EVER manages to get full. And if you do see another reason to stay AFK on a server, don't complain. If you're getting killed over 9000 times because you were having dinner, or were watching TV or anything, it's your problem, not that of others. Alternatively, servers can script stuff for AFK players. Like: - If the main menu is active, cancel damage ( isMainMenuActive() ) - Put AFK players in some remote place with quiet and peaceful background music (for instance St. Marco's Bistro) - Freeze AFK players and their vehicles, and unfreeze when they get back - Kill AFK players in race to make sure others can continue - Simply kick AFK players Conclusion: MTA is just way too flexible for a default pause option. Some gamemodes simply wouldn't work if the main menu would pause the game. Also, scripters have a wide variety of things they can do to solve this problem themselves, so this really should just be left to the servers / gamemode scripters to solve, not MTA in general. So again, either quit when going AFK, or live with being killed or whatever.