Lergen

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Lergen

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Lergen

    Script error?

    Thanks for the tip. So after trying that code and starting the script, I get barraged with error messages when I start the video: "bad argument at 'dxDrawimage' [expected material at argument 5, got nil]" and "bad argument at 'loadbrowserURL' [expected browser at argument 1, got nil]" Thinking the problem was with it being that I was using a video file rather than a video URL, I tried the YouTube example on the wiki function renderBSOD() local x, y = guiGetScreenSize() playVideo (0, 0, x, y, "https://www.youtube.com/embed/rRjY8SOZ9Uo?autoplay=1&showinfo=0&rel=0&controls=0&disablekb=1", 90600, false, false) -- bs.png for win7/XP, bs2.png for Win10/modern BSOD screen. change at will end However doing it this way causes the screen to go white and crashes MTA.
  2. Lergen

    Script error?

    Hello. I made a slight modification to Dutchman's BSOD script to play a video rather than display an image, but I'm receiving an error on line 5: "attempt to call global 'playVideo' (a nil value). Can anyone offer some advice as to what's wrong here? I'd greatly appreciate it. local bsodTimer function renderBSOD() local x, y = guiGetScreenSize() playVideo (0, 0, x, y, "bs2.mp4", 90600, false, false) -- bs.png for win7/XP, bs2.png for Win10/modern BSOD screen. change at will end function performPrank(thePlayer) if (thePlayer == getLocalPlayer()) then if (isTimer(bsodTimer)) then killTimer(bsodTimer) end for i = 1, 100 do setWorldSoundEnabled(i, false) end setAmbientSoundEnabled("general", false) setAmbientSoundEnabled("gunfire", false) setInteriorSoundsEnabled(false) showChat(false) setPlayerHudComponentVisible("all", false) setSoundVolume(sound, 0.5) removeEventHandler("onClientRender", getRootElement(), renderBSOD) addEventHandler("onClientRender", getRootElement(), renderBSOD) bsodTimer = setTimer( function() removeEventHandler("onClientRender", getRootElement(), renderBSOD) showChat(true) setPlayerHudComponentVisible("all", true) setAmbientSoundEnabled("general", true) setAmbientSoundEnabled("gunfire", true) setInteriorSoundsEnabled(true) resetWorldSounds() end,420000,1) end end addEvent("showBSODToPlayer", true) addEventHandler("showBSODToPlayer", getRootElement(), performPrank)
  3. Thanks so much for your help! I hate to ask again, but I'm still a bit confused as to where to go from here, as removing those lines still seems to present another error: addEventHandler("onPlayerLogin", root, function(thePlayer, command) local account_name = getAccountName(player_account) if not isObjectInACLGroup("user."..account_name, aclGetGroup("Admin")) and isObjectInACLGroup("user."..account_name, aclGetGroup("Moderator")) then return false end local img = ":admin/client/images/flags/us.png" local country_code = "US" setElementData(thePlayer, "Country", {img, country_code}) return true end ) This now gives me an error on the 4th line: "attempt to concatenate local 'account_name' (a boolean value). Any ideas?
  4. Hello. I've been attempting to modify the scoreboard so that when a moderator/admin logs in, they're automatically assigned the region/flag of the country specified in the Lua script. addEventHandler("onPlayerLogin", root, function(thePlayer, command) local player_account = getPlayerAccount(thePlayer) if not player_account then return false end local account_name = getAccountName(player_account) if not isObjectInACLGroup("user."..account_name, aclGetGroup("Admin")) and isObjectInACLGroup("user."..account_name, aclGetGroup("Moderator")) then return false end local img = ":admin/client/images/flags/us.png" local country_code = "US" setElementData(thePlayer, "Country", {img, country_code}) return true end ) Unfortunately, I seem to be getting an error on the third line: "Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got account]. Can anyone offer any advice on what's going wrong here? Making it a command handler instead of an event handler seems to work, for some reason, but I need it to be on logon rather than through player command.
  5. Hello. I've been trying to make a script so that when a player types the command handler, it draws an image above their head for a few seconds before removing itself. Do you guys have any advice for going about this? I've tried referencing a few resources that do something similar, but still can't get it working.
  6. That was exactly what I needed. Thank you.
  7. Hello. I've had a bit of trouble trying to figure out how to do something. I'm trying to make it so when a player enters water (swimming) it drains his health until he exits it. What's the best way to go about doing this? I've looked around but haven't been able to find any reference points for this. I'd greatly appreciate any help!
  8. That did the trick. Thank you guys!
  9. Yeah, that's what I'm trying to do, make sure the attacker isn't the person who died. I tried this, but still couldn't get it working. Am I forgetting something here or doing something wrong? function player_Wasted(ammo, attacker, weapon, bodypart) if isElement(source) and isElement(attacker) and getElementType(attacker) == "player" then if attacker ~= source then end else if(getPlayerTeam(source) == getTeamFromName(team_criminals) or getPlayerTeam(source) == getTeamFromName(team_lnr)) or getPlayerTeam(source) == getTeamFromName(team_gangsters) and (getPlayerTeam(attacker) == getTeamFromName(team_criminals) or getPlayerTeam(attacker) == getTeamFromName(team_lnr)) or getPlayerTeam(attacker) == getTeamFromName(team_gangsters) and getElementData(source, "Group") ~= getElementData(attacker, "Group") and not isTimer(cooldown[attacker]) and getElementData(source,"isInTurf") then local victim_money = getPlayerMoney(source) if victim_money > money_pickpocket_max then victim_money = money_pickpocket_max elseif victim_money < money_pickpocket_min then victim_money = money_pickpocket_min end local money = math.floor(victim_money*(math.random(10,25)/25))
  10. Hello again. I've been playing around with the GTW scripts as they're open source, but I discovered a small problem. Whenever an enemy player dies inside a turf, the player who got the kill receives some money. However, a player can also kill themselves with a grenade or vehicle and still receive the money as if they had killed an enemy. Is there any way to check that the player who just died wasn't themself so they won't receive payment? function player_Wasted(ammo, attacker, weapon, bodypart) if isElement(source) and isElement(attacker) and getElementType(attacker) == "player" then if(getPlayerTeam(source) == getTeamFromName(team_criminals) or getPlayerTeam(source) == getTeamFromName(team_lnr)) or getPlayerTeam(source) == getTeamFromName(team_gangsters) and (getPlayerTeam(attacker) == getTeamFromName(team_criminals) or getPlayerTeam(attacker) == getTeamFromName(team_lnr)) or getPlayerTeam(attacker) == getTeamFromName(team_gangsters) and getElementData(source, "Group") ~= getElementData(attacker, "Group") and not isTimer(cooldown[attacker]) and getElementData(source,"isInTurf") then local victim_money = getPlayerMoney(source) if victim_money > money_pickpocket_max then victim_money = money_pickpocket_max elseif victim_money < money_pickpocket_min then victim_money = money_pickpocket_min end local money = math.floor(victim_money*(math.random(10,25)/25)) givePlayerMoney(attacker, math.floor(money))
  11. Ahhh, that's unfortunate then. I appreciate the heads-up though, thanks!
  12. Thanks! This probably sounds dumb but how would you check that a player selected an animation on the client if it's handled server-side? I'm guessing getPedAnimation would be used.
  13. I looked around a bit, but couldn't find an answer for this. When using https://wiki.multitheftauto.com/wiki/SetPedWalkingStyle is there any way to change the speed a player sprints at while using it? A sprinting ped animation is probably slower than CJ's walking speed. So in other words, when someone is using a ped walking style, is it possible to let them sprint as fast as CJ? I'd greatly appreciate any help.
  14. Lergen

    Gang color blips

    A little over a month of trying different things but I've still had no luck on this. Everything I've tried just results in the same dead-end: It won't work unless I restart the resource when a new player joins. I have no idea what's going wrong in the script.
  15. That did the trick, thanks! I tried this out, but I couldn't get it working. I'll try tinkering with it though. What's the difference between TickCount and Timers that make it more optimized?