-
Posts
68 -
Joined
-
Last visited
Everything posted by Jockie
-
Is it possible to get the number of "alive" and "death" of every player then? function checkPlayers() local players = getElementsByType("player") for everyone,player in ipairs(players) do local state = getElementData(player, "state") -- ? playedPlayers = alive+dead end end addEventHandler("onPlayerQuit", getRootElement(), checkPlayers)
-
.. It's possible with getElementData(player,"Race rank") EDIT: Also not possible.. o.o' EDIT2: It works, sort of, only for 1 player. The coins amount of the others doesn't change, when they win.
-
I've created a coins script, it gives coins after everymap. I'm using this script while Race is running. But it gives everyone coins instead of 1 player.(even when one player is online. (Normally the script gives coins @ 2 or higher players)) http://mta.pastebin.com/gQeL357K
-
Thanks! O,O' Only one thing, the race resouce problem, the window doesn't show anymore when the map changes.
-
I don't know what's wrong with this script. There are some stats saved into the account data and I want that the player can see the stats by a showing a window when clicked on a vehicle. But the window doesn't work/show at all. Also, this script is on when playing Race, everytime after a travel screen, the mouse won't show anymore with M. http://mta.pastebin.com/dZZ6px05
-
Map editor doesn't work well with Race, maybe everyone already knows that, or not. I want to test my race map with the race definitions. I have this problem also at the previous MTA 1.0 versions. [XX:XX:XX] Starting freeroam [XX:XX:XX] start: Resource 'freeroam' started [XX:XX:XX] ERROR: mapmanager: Map 'editor_test' is not compatible with 'race'. [XX:XX:XX] WARNING: saveloadtest_server.lua: Bad argument @ 'addEventHandler' - Line: 309 [XX:XX:XX] Stopping freeroam "Test could not be started! 'editor_main' may lack sufficient ACL previlages to start/stop resources. (3)" It's not the acl.xml. <acl name="MapEditor"> *snip* <right name="command.listresources" access="false" /> <right name="command.start" access="true" /> <right name="command.stop" access="true" /> <right name="command.stopall" access="false" /> *snip* </acl> Please don't say... "Use search goddamnit!" or on an other way, because I haven't found anything about this. ^.^
-
Oops.. thx. >.> DELETE.
-
function moveBarrel(object) local x,y,z = getElementPosition(object) moveObject (object, 45000, x - MOVE_DELTA, y, z) setTimer(respawnBarrel,45000,1,object) end function respawnBarrel(object) destroyElement(object) newBarrel = createObject( 1225, 3923.9899902344, math.random(461,351.8), 2.0592248439789, 90,0,0) setTimer(moveBarrel, 50, 1, newBarrel) end And this: http://img28.imageshack.us/img28/6507/createobjectpr.png
-
I'm a bit sad because I can't use this. createObject( 1225, 3923.9899902344, math.random(461,351.8), 2.0592248439789, 90,0,0) It would be usefull for spawning random objects at random places. :>
-
And smoking a fricking ciggarette.. Damn hopping bug... -_-' Glad it's over now..
-
Nah, not needed. The map of my server is almost full with stunts.
-
Maybe you haven't started the superman resource? Or you haven't login?
-
*Grrrrr*... How did you know? Nah j/k, I know, but the real thought about it is above your post.
-
*Oh no* Another request. I want to use this function so much, but It's hard to create an own function of it. This can be used for god-mode or for shields in DMs. bool setElementInvincible ( element theElement, bool invincible ) _____________^setElementInvincible
-
Because there is some other places I want to add. And the short name of it is SS, SkyScraper. Freeroam resource is also installed on the server. So.. Freeroam + /ss = SetSkin + SkyScraper teleport. If I use for all the teleports / and for the SkyScraper //ss. You would think: What the hell? Why double /?
-
Yes, only client-side script is working. The vehicle teleport was not working, but I've turned: if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end Into: if veh then setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) else setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) end And now it's working.
-
Only the client-side is working, except the vehicle teleport. I hate when It's only working at client-side. And luac5.1.exe is not working, it's getting better and better! X.X
-
Doesn't work. Still bad argument @ getElementDimension.
-
I want to create a teleport. (As you can see at the code) Don't ask: Why /home @ commandHandler?: because I want "//home" as command. ^.^ The console says that there is a bad argument at getElementDimension.. (Oh fricking dimensions) Why only dimension 0? That's secret. This is just a small part. ^^ player = source veh = getPedOccupiedVehicle(source) dimension = getElementDimension(source) function teleHome () if dimension == 0 then if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome) I've also tested: veh = getPedOccupiedVehicle(player) dimension = getElementDimension(player) function teleHome () if dimension == 0 then if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome)
-
*advertising* http://mtahostings.com I'm also using this host. :]
-
Damnit... Damnit... OMG. Stupid S... I'll try it again. EDIT: Nope, nothing. I'm now with this. function popTheTires(vehicle) setVehicleWheelStates(getPedOccupiedVehicle(source), 1, 1) end function burnoutTheTires(vehicles) if (burnoutTimer == nil) then bournoutTimer = {} end if getKeyState ("s") == true or getKeyState("arrow_d") == true then burnoutTimer[player] = setTimer(popTheTires,5000,1) else outputChatBox(source, "*You want to do a burnout while walking?") end end bindKey(source,"arrow_u","down",burnoutTheTires) bindKey(source,"w","down",burnoutTheTires) function unpressedTheKeys(vehicles) if getKeyState ("s") == false or getKeyState("arrow_d") == false then if (isTimer(burnoutTimer[player])) then killTimer(burnoutTimer[player]) end else return end end It says the whole time: [14:34:40] WARNING: burnout.lua: Bad argument @ 'bindKey' - Line: 15 [14:34:40] WARNING: burnout.lua: Bad argument @ 'bindKey' - Line: 16
-
When I press W and S, W and Down, Up and S or Up and Down, the script is doing nothing. Instead of creating a timer to pop the tires... That's what I mean with it isn't working.
-
I'm creating a burnout script, but it seem it isn't working. function popTheTires(vehicle) setVehicleWheelState(getPedOccupiedVehicle(source), rearLeft, 1) setVehicleWheelState(getPedOccupiedVehicle(source), rearRight, 1) end function burnoutTheTires(vehicles) if (burnoutTimer == nil) then bournoutTimer = {} end if getKeyState ("s") == true or getKeyState("arrow_d") == true then burnoutTimer[player] = setTimer(popTheTires,5000,1) else outputChatBox(source, "*Why do you want to create a burnout while walking?...") end end bindKey("arrow_u",getRootElement(),burnoutTheTires) bindKey("w",getRootElement(),burnoutTheTires) function unpressedTheKeys(vehicles) if getKeyState ("s") == false or getKeyState("arrow_d") == false then if (isTimer(burnoutTimer[player])) then killTimer(burnoutTimer[player]) end else return end end bindKey("arrow_u",getRootElement(),unpressedTheKeys) bindKey("w",getRootElement(),unpressedTheKeys) function isTimer(timer) local timers = getTimers() for k,v in ipairs(timers) do if (v == timer) then return true end end return false end
-
First, I'm not a rookie (anymore)... Second, yes I've added a leaf.dimension and added it to the .XML file and a somewhere else. So, this is the part of the script that's done, but still setElementDimension is not working... And Yes.. I've added these scripts to meta.xml. This is the a part of the edited Freeroam. function setCurrentGame(leaf) server.setElementInterior(g_Me, leaf.world) server.setElementDimension(g_Me, leaf.dimension) local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then outputChatBox("Get out of your vehicle.") return end setCameraInterior(leaf.world) setPlayerPosition(leaf.posX, leaf.posY, leaf.posZ + 1) closeWindow(wndSetCurrentGame) end wndSetCurrentGame = { 'wnd', text = 'Minigames List', width = 250, controls = { { 'lst', id='minigames', width=230, height=300, columns={ {text='Minigame', attr='name'} }, rows={xml='minigames.xml', attrs={'name', 'posX', 'posY', 'posZ', 'world', 'dimension'}}, onitemdoubleclick=setCurrentGame }, {'btn', id='close', closeswindow=true}, {'lbl', text=' Double click to join'} } } Part of the minigames.xml file <catalog type="interior"> <group name="Test 1"> <interior name="Spawn 1" posX="1304.5737304688" posY="2107.1997070313" posZ="11.015625" world="0" dimension="101"/> <interior name="Spawn 2" posX="1382.9158935547" posY="2184.7958984375" posZ="11.0234375" world="0" dimension="101"/> <interior name="Spawn 3" posX="1410.544921875" posY="2102.7780761719" posZ="12.015625" world="0" dimension="101"/> <interior name="Spawn 3" posX="1298.2655029297" posY="2211.9970703125" posZ="12.015625" world="0" dimension="101"/> </group> </catalog> So I want that the players will spawn in Interior 0(outside) and dimension 101. But the player is always spawning in Dimension 0 of Interior 0. EDIT: Ahaahh... @ Server-side: I just needed to add this.. g_RPCfunctions = { ... removePedJetPack = { option = 'jetpack', descr = 'Removing a jetpack' }, removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, --setElementDimension = true, setElementPosition = true, setElementInterior = true, ... } Thx 50p for helping me a bit...
-
function setLocation(leaf) server.setElementInterior(g_Me, leaf.world) server.setElementDimension(g_Me, leaf.dimension) setPlayerPosition(leaf.posX, leaf.posY, leaf.posZ + 1) closeWindow(wndSetLocation) end So it needs to look like this.. But still the dimension is not changing, only the interior..