-
Posts
256 -
Joined
-
Last visited
-
Days Won
3
Everything posted by marty000123
-
It works perfectly, thanks so much! And yeah your outputChatBox was way better than mine. Your help definately helped Thanks again man, this problem is solved.
-
Hi Pollo, I really appreciate your help, senpai! But sadly it didn't work. I'm still having the same issue, it didn't help at all. The errors did go away, so thanks for that But can you look into it again please? When I get killed twice in a row after having a 3-killing-streak, I still see the message that someone ended my killing-streak, and vice versa.
-
Hi! Thanks so much for the detailled script and explaination! But there's a but, there shouldn't be any timer until he gets hit. I mean like, I can slap myself 500 times, but when I get hit by a player, the timer sets itself on 2 minutes etc. You know what I mean? About the outputChatBox, it was wrongly placed I meant to put it on the place where the player clicks on ''Slap Me'' but it would refuse to slap him because he would've been hit less than 2 minutes ago. Can you fix that?
-
Hi Pollo, thanks for the tip. But how do I do that? I know that it has to do something with https://wiki.multitheftauto.com/wiki/OnPlayerDamage and https://wiki.multitheftauto.com/wiki/ResetTimer but I don't really know how to put this into the script without :Oing something up again. I have to add something like this, I guess?: (it probably doesnt make any sense, so please help) function playerDamage_text ( attacker, weapon, bodypart, loss ) if ( bodypart => 0 ) then resetTimer(aTimer) outputChatBox ( "You can't be shot less than 2 minutes ago in order to use this function!", getRootElement (), 255, 0, 0 ) end end addEventHandler ( "onPlayerDamage", getRootElement (), playerDamage_text )
-
I know it doesn't make much sense because I barely know how to script so I'm basically just putting loose parts together I found on the wiki Therefor I'm not fully sure how to solve it even with your information. And does it fix the warnings/errors at the same time or is this a different problem?
-
Thanks for the tip, it now works! But there's just one major issue, it only TP's when I'm on foot and it doesn't TP me and my car when I'm inside of a vehicle, which is the point of this script. Help?
-
<meta> <info author="Maarten" type="map" version="2.0.0"></info> <script src="MaartenGarageScript.lua" type="server"></script> </meta>
-
It doesn't reset. When I get killed after having a 3killing-streak it says that someone stopped my killing streak. If I respawn and if someone kills me, it again says that he stopped my killing-streak while I shouldn't have a killingstreak because I didn't kill anyone.. It does give me 3 errors: [color=black][2016-11-19 05:47:47] WARNING: killstreak\server.lua:16: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] [2016-11-19 05:47:47] ERROR: killstreak\server.lua:17: attempt to perform arithmetic on local 'exp' (a boolean value) [2016-11-19 05:47:47] WARNING: killstreak\server.lua:41: Bad argument @ 'getElementData' [Expected element at argument 1, got number '1'][/color] (for some reason the letters turned white so just mark the text to be able to read it) The full script can be found here: http://pastebin.com/HhFzYpcz Thanks for the help guys.
-
Hi, thanks for the help. Sadly, it didn't work. It didn't give me a warning/error in debugscript 3, but it just doesn't want to RP me or my car. http://imgur.com/a/D9OGY
-
Thanks, you'll hear from me soon if it worked or not!
-
Hi. Thanks for your help! Your timer works, but I want the timer to start after being hit, so you can slap yourself anytime you want but if you get any damage (BY A PLAYER) then you shouldn't be able to slap for 2 straight minutes. That's what I meant. Thanks though. Marty
-
Hi there function resetKillingstreak (player) local killstreaks[source] >= 0 = getElementData( player, "killstreaks[source]" ) if ( killstreaks[source] >= 0 ) then --They have a killingstreak higher than 0 --We will want to reset the element data back to its default (that being false) setElementData ( player, "killstreaks[source]", false ) end addEventHandler("onPlayerWasted", getRootElement(), resetKillingstreak) I have a killingstreak script, but it didn't reset when you respawned, so when you died and killed someone after spawning it would for example tell you you're on a 10 killing streak, while you should've lost your killingstreak obviously. So I've worked on the script given above, but it gives the following error: (found an unexpected symbol near ''['') Now I'm not entirely sure what to do.. This isn't my first help request today, but I'm trying to learn LUA the best I can. So yeah help will be appreciated. Marty
-
Hi. marker = createMarker(-2712.5,217.6,4, "corona", 1,255,255,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == marker then setElementPosition(vehicle, -2722, 207, -9) setElementFrozen(vehicle, true) setTimer(setElementFrozen, 1000, 1, vehicle, false) end end end addEventHandler("onClientMarkerHit", getRootElement(), teleport) The point of this script is to TP the player and it's vehicle to the given setElementPosition. A friend of mine made this, but we couldn't figure out why it doesn't work. When you get into the marker, you should get TP'd to the wanted destination, but it doesn't, it doesn't TP you anywhere. It doesn't work while on foot and it doesn't work when you're in a vehicle. Again, help would be very appreciated! Marty
-
Hi. function slap() x,y,z = getElementPosition(source) setElementPosition(source,x,y,z+5) if ??? then cancelEvent () end end addEvent("slap",true) addEventHandler("slap",getRootElement(),slap) This is a part of my script. As you can see it slaps the player with 5 height. But I want to allow this only if the players hasn't been hit for 2 straight minutes. But I have no idea how to make that. I assumed that I had to put something between ''if'' and ''then'', but after a few tries I couldn't figure out what was needed. Help would be appreciated! Marty
-
[2016-11-15 11:44:25] ERROR: gambling\server.lua:21: bad argument #1 to '?' (table expected, got userdata) [2016-11-15 11:44:29] ERROR: gambling\server.lua:14: bad argument #1 to '?' (table expected, got userdata) [2016-11-15 11:44:31] ERROR: gambling\server.lua:21: bad argument #1 to '?' (table expected, got userdata) This works, thanks!
-
Hi. That didn't work, and it shows no errors or warnings on debugscript 3. I can simply run into the marker, run out, run into it again and it'll keep giving or taking me/my money. I see no timer effects, help?
-
Hi folks. This is my gambling script. I've tried multiple ways to put a timer on this, but I kept failing. I want it to have a timer for 30 seconds, so you can only gamble every 30 seconds. Selfexplainatory But after putting a timer on it, it didn't work.. Do you guys have a solution? If you enter the marker before the 30 seconds have passed, it will say ''You have to wait 30 seconds!''. - Marty
-
After looking in the script again, I found that I forgot to place one group in the ACL. I now fixed it by removing that 1 group from the script. Thanks for the help
-
I still don't have a clue about what to do because the script works, I added those groups to the ACL, and it's giving a Warning as output, not an ERROR. So everything should be fine but still it gives the warning everytime someone says something. I really suck at scripting so I'm probably missing something obvious.
-
http://pastebin.com/EmKaK0h5 I didn't make the script myself but made some edits. Might have :Oed something up, but I can't figure out what's wrong.
-
for _,v in ipairs(settings['adminTag']['ACL']) do if isObjectInACLGroup('user.' .. account, aclGetGroup(v[1])) and check == 0 and not spam[serial] then local message = v[2] .. RGBToHex(r, g, b) .. name .. ":#FFFFFF " .. text If you need more lines please let me know.
-
When I check the console or /debugscript 3, everytime someone says something in the chat I get this: [2016-11-12 15:39:13] WARNING: admintag\server.lua:98: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got boolean] Does anyone have an idea what to do? Thanx.
-
Sick dude, it worked! Thanks alot!