-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
else if In lua you have to write it like this: elseif
-
[quote name=..&G:..]Any ideas why I get "C stack overflow" here? for s, o in pairs(occupants) do You will only get that error when you are calling a function inside this loop, which is related to the function which contains this loop. This is an example how you get this error: function testFunction () testFunction() end testFunction()
-
Read this: https://www.lua.org/pil/4.3.1.html
-
Random selection is required when there are equal players in each team. Try to replace: local teamName = theTeams[1] To local teamName = theTeams[#theTeams] It seems it was placing players in the largest team instead of the smallest team. If you say it doesn't work, you should tell me WHAT exactly. This is really getting annoying. If you did debug your code correctly(not just the console), you would have figured this out on your own.
-
Selecting players randomly? You never said anything about random players, only (random + 1 by 1) adding player to team. Which is doing that. If you still have your doubts about that, why don't you check theTeams table?
-
Probably because the objects you removed took part in the collision of the floor. You will have to fix that with other objects. (make them invisible) That's the only advise I can give you.
-
Did everybody found the childish 'Easter egg'? If you did, then I am feeling very sorry for your headache... It wasn't meant to be in it, but I couldn't make a 100% serious resource. So I had to program something NOT serious in it, although it is a bit childish. Don't tell others about this 'Easter egg' if you found it, unless you really hate them..
-
local _, _, z1 = getElementPosition (hitElement) local _, _, z2 = getElementPosition (source) if math.max(z1-z2, z2-z1) < 3 then end It does have one bug. If you fall from the sky, it will not trigger. Because you already triggered it when you entered the sky. Or use as detection a colshape. (you don't have to delete the marker) https://wiki.multitheftauto.com/wiki/CreateColSphere @Miika822 as you said... I was still replying, when you did answer your own question.
-
It is not from the gamemode play, but from freeroam. Open [play]/play.zip Open the meta.xml from the zip. Then you see this: <meta> <info author="BrophY" description="A playtest/freeroam mode" version="1" type="gamemode" /> <include resource="freeroam" /> <include resource="spawnmanager" /> <settings> <setting name="*spawnreset" value="onSpawn" friendlyname="Spawn Reset" accept="onSpawn,onServerEmpty,onServerStart" desc="When should a new spawnpoint be chosen?" /> </settings> <map src="broph.map" /> <script src="broph.lua"/> </meta> Remove this line: <include resource="freeroam" /> Like this: <meta> <info author="BrophY" description="A playtest/freeroam mode" version="1" type="gamemode" /> <include resource="spawnmanager" /> <settings> <setting name="*spawnreset" value="onSpawn" friendlyname="Spawn Reset" accept="onSpawn,onServerEmpty,onServerStart" desc="When should a new spawnpoint be chosen?" /> </settings> <map src="broph.map" /> <script src="broph.lua"/> </meta> Save the file. Save the archive. When you click on your zip opened in winrar, it will tell you that there have been some changes. Click on OK and it will save it. /restart play or /start play
-
There is one other, render them at position. "onClientPreRender" setElementPosition
-
Not everybody is a scripter. So if you really want to sell this, spend some time on use ability.
-
Beta release: (1.0.2) Subscribed scripters, check your message folder! Video of pre version 1.0.2
-
As promised, your names are on it: If I missed anyone, let me know.
-
Nice! Don't forget to check out this page, for scripters like you: https://forum.multitheftauto.com/viewtopic.php?f=108&t=98182
-
Great,
-
[quote name=..&G:..] local accID = getAccountID(username) or 0 dbExec(connection, "INSERT INTO `userdata` SET `userid`='" .. accID .. "', `online`='0', `username`='" .. username .. "', `usergroupid`='0', `registered`='1', `admin`='0', `joined`='" .. getTheTime() .. "', `team`='nil', `serial`='"..getPlayerSerial(player).."', `ip`='"..getPlayerIP(player)"', `lastvisit`='"..getTheTime().."', `cc`='EN', `playtime`='0', `settings`='0', `stunts`='0', `tuning`='0', `shooterlevel`='0', `clan`='0', `arena`='0', `language`='Enlgish', `autosave`='1', `special`='0', `nickname`='"..getPlayerName(player).."', `dmRak`='0', `raceRank`='0', `ddRank`='0', `trialsRank`='0', `runRank`='0'") Any ideas why I keep getting "Attempt to call a string value" here...? Thanks. And the data must be added as parameters, not as the query string. dbExec( connection, [color=#FF0000]"INSERT INTO table_name VALUES (?,?,?)"[/color][color=#0000FF][b],[/b][/color] [color=#008000]"aaa"[/color][color=#0000FF][b],[/b][/color] [color=#008000]"bbb"[/color][color=#0000FF][b],[/b][/color] [color=#008000]10[/color] ) query string parameters/data separate by comma https://wiki.multitheftauto.com/wiki/DbExec
-
There is another solution, open in your admin tag resource, the serverside file: https://wiki.multitheftauto.com/wiki/WasEventCancelled https://wiki.multitheftauto.com/wiki/OnPlayerChat When the event onPlayerChat gets executed, use this: if not wasEventCancelled() then -- all other code inside that function end It will checks if the the event was cancelled. If it is not cancelled, then show the admin tags. (if the event "onPlayerChat" is cancelled, the typed text doesn't get added in to the chatbox)
-
Controls? local playersTime = 0 local playersTimer local secondsHold = 5 -- And after the 5 seconds It would be good if it puts in the Chat "You have pressed the key H X times" addEventHandler( "onClientKey", root, function(button, press) local ckeys = getBoundKeys("crouch") if ckeys and ckeys[button] and press then if not isTimer(playersTimer) then outputDebugString("start playersTimer") playersTimer = setTimer(function() outputChatBox("You have pressed the crouch key "..playersTime.." times") playersTime = 0 end, secondsHold*1000, 1) else playersTime = playersTime + 1 outputDebugString("playersTime + 1 = " .. playersTime) end end end) Custom keys? local playersTime = 0 local playersTimer local secondsHold = 5 -- And after the 5 seconds It would be good if it puts in the Chat "You have pressed the key H X times" local whichKey = "h" addEventHandler( "onClientKey", root, function(button, press) if whichKey == button and press then if not isTimer(playersTimer) then outputDebugString("start playersTimer") playersTimer = setTimer(function() outputChatBox("You have pressed the key " .. whichKey .. " " ..playersTime.." times") playersTime = 0 end, secondsHold*1000, 1) else playersTime = playersTime + 1 outputDebugString("playersTime + 1 = " .. playersTime) end end end)
-
This is a part of my syncro resource, which converts weapon stats to: poor std and pro. local weaponStats = { [22]={69,40},[23]={70,500}, [24]={71,200},[25]={72,200},[26]={73,200}, [27]={74,200},[28]={75,50},[29]={76,250}, [30]={77,200},[31]={78,200},[32]={76,50}, [33]={79,300},[34]={79,300} } local weapon = 22 local weaponState, skill = weaponStats[weapon], "pro" if weaponState then local stats = getPedStat ( localPlayer, weaponState[1] ) if stats < 999 then skill = stats >= weaponState[2] and "std" or "poor" end end I hope this can help you as inspiration.
-
The version 1.0.2 will be released within 10 days. Which includes mostly bug fixes. Bugs already fixed in 1.0.2: Hidden folders. [gamemodes]\[hidden] Debug information without line numbers. And more... Improvements No delay when showing information as you click on the grid list, except for the line preview and resource state that is requested. New Starting and stopping resources? Status running Status not running
-
Ah oke. You received it?
-
Hey @CodyL, It seems you disabled your incoming pm's somehow. So check your mail instead! There is a link for the download, enjoy! (try to enable your incoming pm's 'settings', for updates in the future)
-
use the serial as key: local serialToPlayer = {} serialToPlayer[getPlayerSerial(source)] = source if serialToPlayer[getPlayerSerial(thePlayer)] then
-
Beta release: (1.0.1) Subscribed scripters, check your message folder! Upcoming features, improvements and bug fixes: Stop and start/restart resources with errors/warnings Minimize window Download reduction (debug information) Stops the data transfer when reaching the maximal amount of transfers Custom ID system, which will give more options for other features. Move the window Saving the planet! Scale the window Fixed bug: not showing the cursor when the window is not active Zero state Local saving settings Serverside: collecting errors and warnings from both sides, so you can also check errors/warnings from other players.(95%) + ugly GUI (Serverside: collecting errors and warnings from both sides) database? Direct line edit based on the error. Exporting to the File editor resource from Gothem. ■ Finished ■ Working on ■ Waiting... Now you can move the window, included some extra options: Move the window by simply dragging it to anywhere you want! (when your cursor is at the header) Auto adjust to the borders of the screen (left and right) When the window is used on the right side of the screen, the debug information will align on the right side of the window. Now you can scale the window: Inform the user, when the window can be scaled. When you are scaling the window. View debug information from other clients and save them while your away. (does not have a database yet, so keep it running) Important! from (1.0.1): The key combination to show the cursor is now: Left shift + Z
-
nope, if [b][color=#FF0000]not[/color][/b] getPlayerTeam(player) then -- set in team Make sure you update the version correctly.
