tma
Members-
Posts
173 -
Joined
-
Last visited
Everything posted by tma
-
I had a go at this kind of thing - it produces some weird results ( ).The fences are part of the map (manager). The barrels I create. Neither has collision while attached, but the created vehicles do (dinghies trapped in the "cage" and then stuck to my car). Edit : I have to go to the remote cam because the attached dinghies block the driver view. Also, the weight of the dingies on the car pushes the front down enough for it to lift the rear end.
-
I usually just start a game round by using triggerClientEvent() and passing any variables the client needs (round duration etc.) to a client-side event which I've made e.g. "startRace"
-
You can compile Lua scripts (see AlienX's freeroam cached files) but then you can decompile them too so what's the benefit ? (It's like Java)
-
Trying to upload it to the resource center but keep getting : Fatal error: Cannot redeclare checkincludever() (previously declared in /home/mtabeta/www/modules/resources/upload.php:139) in /home/mtabeta/www/modules/resources/upload.php on line 139 I take it it's down currently ?
-
This seems to be broken currently ? @ gr00ve - yeah I've only had 8 people playing but it was fun. It'll support any number of players as the road creation is dynamic - four players to each one.
-
Thanks. BTW, I messed up with the original upload and left file paths in the Zip. If you have downloaded it already, do so again.
-
Hey. After testing my game mode over the last few days I think it's ready for other people to have - thanks to all the players who dropped by and help me debug it. Tilt is a car DM on moving roadways - check out a video here : You can download the latest files here. Latest version is 0.8 Note : As is the "spirit" of MTA, I've re-used some of the code from the race mode (mainly the table extensions). If you want to modify the game settings, extract the files from the zip (into a folder called "tilt") and use it that way (no .zip file). Then look in the meta.xml and modify such things as round duration, weather, vehicle and world position. Have fun! / Post any issues.
-
Why too complicated ? That's about the minimum code for both situations you need to handle - game mode start and players joining.
-
Ah OK, that makes sense. Seems a little odd forward references aren't handled. I thought with LUA being "compiled" (turned into byte code), it would sort the references out ? Or is it fully interpreted in MTA ? I was thinking not because I've seen mods with pre-compiled LUA code (e.g. the AlienX freeroam) and so assumed LUA source was first turned into byte code where static references would be resolved. The more you know ...
-
You you're right about the local thing - I didn't realise "local globals" would remain. But you're wrong about the timer thing - setTimer() can forward reference - there's no need for the function to be defined first. In fact, I'm not even sure what's wrong with this code - I copy/pasted into a game mode of mine and it works fine?
-
That's perfectly fine - the "0" param means to continually fire the event. I tried your code - it's the "local" next to the "messageNum" variable - get rid of it. You want you counter global so it can be accessed inside your message function. The rest of it is fine.
-
I'm not quite sure what you want but look at the race mod - server_util.lua. In there is a function called "destroyBlipsAttachedTo" - I use that for removing radar blips attached to a player e.g. destroyBlipsAttachedTo(getLocalPlayer()) to remove any blips attached to "me".
-
I was confusing the issue - I meant to remove the display of the clock; not to stop the clock entirely. The line of code I posted above is supposed to remove the display of the clock but never seems to do anything.
-
To add : can you remove the clients world-time clock ? In the WIKI there's an option for it using : showPlayerHudComponent("clock",false) but it never seems to work ?
-
This works for the time (put it server side) : function setWorldClock() setTime(12,0) end setTimer(setWorldClock,5000,0)
-
With the time of day, the only thing I can think of is to set a server timer to keep resetting the system clock (the setTime() function). The boost/speed jump - well, you can give a car nitro easily enough. I've also done a speed booster which accelerates the car along is currents direction - that would achieve the tractor effect (high altitude).
-
X is east/west and Y north/south. So yes, increasing your Z raises the spawn point off the ground.
-
Also, if id = 451 then should be if id == 451 then
-
Put it where you put your normal player spawn - you must have this to be playing on your server. You can also do something like : -- A global list of starting positions (x,y,z) for each spot spawnPoints = {{0,0,0},{0,0,30},{1000,300,40}} . . addEventHandler('onPlayerJoin',getRootElement(), function() sp = spawnPoints[math.random(1,#spawnPoints)] spawnPlayer(source,sp[1],sp[2],sp[3]) end ) All I'm showing you is how to spawn a player at a random pre-determined spawn point. Where this code belongs in your servers code is not something I can explain. No it doesn't do skins.
-
spawnPlayer(player,math.random(1,6) * 5,math.random(1,6) * 5,0) Not tested it but that should spawn a player on a 6x6 grid at height 0 (the centre of the world). Add in x,y,z offsets for your start area.
-
Regarding it not showing / for the correct length ... You could just drop all your server code and just stick this at the end of onClientResourceStart() : local screenWidth, screenHeight = guiGetScreenSize() setTimer(destroyElement,5000,1,guiCreateStaticImage(0, 0, screenWidth, screenHeight, 'serverlogo.jpg', false, nil)) See if it makes any difference.
-
The only trouble with that is the server ACL must have the commands in to block the user from using them for every game mode installed on the server. This is the reason I added my own account level checks to commands to make sure they wouldn't fire at all by normal users. function playerInACLGroup(player,groupName) local et = getElementType(player) if (et == "player") or (et == "console") then local account = getClientAccount(player) if not isGuestAccount(account) then local un = "user." .. getAccountName(account) local group = aclGetGroup (groupName) for id, object in ipairs(aclGroupListObjects(group)) do if object == un then return true end end end end return false end function playerHasPower(player) -- Return true if the player belongs to any of the priveledged users for i,groupName in pairs({"Moderator","SuperModerator","Admin","Console"}) do if playerInACLGroup(player,groupName) then return true end end return false end
-
[REL] Race map loader (only loads objects) (updated).
tma replied to iam2noob4u's topic in Resources
Yes it does - you don't have do any of the above. When I started I looked at the race doing this manually but then found the map manager. You don't need handle objects / pickups / the weather etc.
