Jump to content

Mossy

Members
  • Posts

    426
  • Joined

  • Last visited

Everything posted by Mossy

  1. I'll test it for ya if he didn't go on yet. IP for your server?
  2. Hey guys. I was looking through 2 Lua files for a login resource and all I see are NUL characters everywhere. What does it mean exactly? For some reason copy and pasting won't work.. so I took a screenshot of the Client file. These NUL characters are also in the server file. Any info would be appreciated. Thanks!
  3. Yeah you're right, I'll either make my own or find another one By the way, nice Shelby in your avatar.
  4. Hey whenever I type a letter in the resource name I get the bug report window. The rest (Author, Description, etc) work fine. Edit:
  5. Hey guys, very sorry for posting a lot but I still have no idea how to fix these errors: The Ghostmode Warning: local VoteCount --define this as a global function addVote(keyPresser) local serial = getPlayerSerial(keyPresser) local serialcheck = executeSQLSelect ( "GmBlockList", "serial","serial = '" .. serial .. "'") if (type( serialcheck ) == "table" and #serialcheck == 0 ) or not serialcheck then executeSQLInsert ( "GmBlockList", "'"..serial.."'") VoteCount = VoteCount + 1 triggerClientEvent("UpdateCount",root,VoteCount,ReqPlayers()) else outputChatBox("You have already voted for Ghostmode!",keyPresser,255,0,0) end end function ReqPlayers() local reqPeds = 0 --define reqPeds just incase there's no players local pcount = getPlayerCount() if pcount == 1 then reqPeds = 1 elseif pcount > 1 and pcount < 4 then reqPeds = 2 elseif pcount > 3 and pcount < 7 then reqPeds = 3 elseif pcount > 6 and pcount < 10 then reqPeds = 5 elseif pcount > 9 and pcount < 15 then reqPeds = 7 elseif pcount > 14 and pcount < 21 then reqPeds = 12 elseif pcount > 20 and pcount < 26 then reqPeds = 17 elseif pcount > 25 then reqPeds = 21 end return reqPeds end function StartElement(vcount,pcount) if not vcount then --check if vcount is passed vcount = 0 --if it isn't, set it to 0 end if not pcount then pcount = ReqPlayers() end triggerClientEvent("UpdateCount",root,vcount,pcount) triggerClientEvent("onGMStart",root) end addEventHandler("onMapStarting",root,function() -- bind the key for all players. if get("g_vote") == 'true' then local pcount = getPlayerCount() triggerClientEvent("onGMStop",root) if string.find(getMapName(), get('filterword'), 1, true) then outputDebugString("DD Detected, Halting the ghostmode voting.") set("race.ghostmode","false") return end executeSQLQuery("DELETE FROM GmBlockList") VoteCount = 0 for _,v in ipairs(getElementsByType("player"))do bindKey(v,"g","down",addVote) setElementData( v, "overrideCollide.uniqueblah", nil, false ) end outputChatBox("Ghostmode Disabled by Server",getRootElement(),255,0,0) StartElement() end end) addEvent("onRaceStateChanging") addEventHandler("onRaceStateChanging",root,function(newStateName) if get("g_vote") == 'true' then if newStateName == "Running" then for _,v in ipairs(getElementsByType("player"))do unbindKey(v,"g","down",addVote) end executeSQLQuery("DELETE FROM GmBlockList") triggerClientEvent("onGMStop",root) if VoteCount >= ReqPlayers() then outputChatBox("*Ghostmode: Voting for ghostmode passed!",root,162,82,201) for _,v in ipairs(getElementsByType('player')) do setElementData( v, "overrideCollide.uniqueblah", 0, true ) end else --[[for k,thePlayer in ipairs(getElementsByType('player')) do setElementData( thePlayer, "overrideCollide.uniqueblah", 255, false ) end]]-- outputChatBox("*Ghostmode: Voting for ghostmode failed!",root,162,82,201) end end end end) And how do I fix the 3 errors? Thanks for the help.
  6. Another question. Does this problem affect the login or just a usual script bug?
  7. --- --- --- --- --- --- --- --- --- --- --Ach1 ==> 50 Race Wins. --Ach2 ==> 30 Explosions. --Ach3 ==> $1000000. --Ach4 ==> 100 Rolls. --Ach5 ==> 100 Spins. --Ach6 ==> 10 Shop Purchases. --Ach7 ==> VIP Purchase. --Ach8 ==> Win a race with 10 or more players:: --Ach9 ==> Change your vehicle light color:: local rootElement= getRootElement() addEvent("onMapStarting") addEvent("onPlayerPickupRacePickup") addEvent("onPlayerReachCheckpoint") addEvent("onPlayerRaceWasted") addEvent("onPlayerFinish") addEvent("onRaceStateChanging") function recover(playerSource) if (isGuestAccount(getPlayerAccount(playerSource)) == false) then accountname = getAccountName (getPlayerAccount(playerSource)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then executeSQLDropTable("RaceWins") executeSQLDropTable("RaceAttempts") executeSQLDropTable("DDDM") executeSQLDropTable("SpinsRolls") executeSQLDropTable("Colors") executeSQLDropTable("LColors") executeSQLDropTable("VColors") executeSQLDropTable("Achievments") executeSQLDropTable("PersonalInfo") executeSQLDropTable("MoneyB") executeSQLDropTable("GmBlockList") outputChatBox("Successfully Recovered. Please restart the resource. /restart race_starter_pack") end end end addCommandHandler("recover",recover) function ResourceStart() executeSQLCreateTable("RaceWins", "serial STRING,RaceWins INT,RaceWins2 INT,RaceWins3 INT,RaceWins4 INT") executeSQLCreateTable("RaceAttempts", "serial STRING,RaceAttempts INT") executeSQLCreateTable("DDDM", "serial STRING,DDAttempts INT, DDWins INT") executeSQLCreateTable("SpinsRolls", "serial STRING,Spins INT,Rolls INT") executeSQLCreateTable("Colors", "serial STRING,Ccolor STRING,Ncolor STRING") executeSQLCreateTable("LColors", "serial STRING,R INT,G INT,B INT") executeSQLCreateTable("VColors", "serial STRING,Col1 INT,Col2 INT,Col3 INT,Col4 INT") executeSQLCreateTable("Achievments", "serial STRING,Ach1 INT,Ach2 INT,Ach3 INT,Ach4 INT,Ach5 INT,Ach6 INT,Ach7 INT,Ach8 INT,Ach9 INT") executeSQLCreateTable("PersonalInfo", "serial STRING,Edit1 TEXT,Edit2 TEXT,Edit3 STRING,Edit4 TEXT,Edit5 TEXT,Edit6 STRING") executeSQLCreateTable("MoneyB", "serial STRING,Money INT,B INT") executeSQLCreateTable("GmBlockList", "serial STRING") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) function ClientReady(g_player) local serial = getPlayerSerial(g_player) local playername = getPlayerName(g_player) local defaultvCol = get("defaultvehiclecolor") local defaultcCol = get("defaultchatcolor") local defaultnCol = get("defaultnamecolor") CheckPlayer = executeSQLSelect ( "RaceWins", "serial", "serial = '" .. serial .. "'" ) CheckPlayer2 = executeSQLSelect ( "SpinsRolls", "serial", "serial = '" .. serial .. "'" ) CheckPlayer3 = executeSQLSelect ( "Achievments", "serial", "serial = '" .. serial .. "'" ) CheckPlayer4 = executeSQLSelect ( "MoneyB", "serial", "serial = '" .. serial .. "'" ) CheckPlayer5 = executeSQLSelect ( "PersonalInfo", "serial", "serial = '" .. serial .. "'" ) CheckPlayer6 = executeSQLSelect ( "VColors", "serial", "serial = '" .. serial .. "'" ) CheckPlayer7 = executeSQLSelect ( "LColors", "serial", "serial = '" .. serial .. "'" ) CheckPlayer8 = executeSQLSelect ( "Colors", "serial", "serial = '" .. serial .. "'" ) CheckPlayer9 = executeSQLSelect ( "RaceAttempts", "serial", "serial = '" .. serial .. "'" ) CheckPlayer10= executeSQLSelect ( "DDDM", "serial", "serial = '" .. serial .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "RaceWins", "'"..serial.."','0','0','0','0'" ) end if ( type( CheckPlayer2 ) == "table" and #CheckPlayer2 == 0 ) or not CheckPlayer2 then executeSQLInsert ( "SpinsRolls", "'"..serial.."','0','0'" ) end if ( type( CheckPlayer3 ) == "table" and #CheckPlayer3 == 0 ) or not CheckPlayer3 then executeSQLInsert ( "Achievments", "'"..serial.."','0','0','0','0','0','0','0','0','0'" ) end if ( type( CheckPlayer4 ) == "table" and #CheckPlayer4 == 0 ) or not CheckPlayer4 then executeSQLInsert ( "MoneyB", "'"..serial.."','0','0'" ) end if ( type( CheckPlayer5 ) == "table" and #CheckPlayer5 == 0 ) or not CheckPlayer5 then executeSQLInsert ( "PersonalInfo", "'"..serial.."','Unknown','Unknown','Unknown','Unknown','Unknown','Unknown'" ) end if ( type( CheckPlayer6 ) == "table" and #CheckPlayer6 == 0 ) or not CheckPlayer6 then executeSQLInsert ( "VColors", "'"..serial.."','"..defaultvCol.."','"..defaultvCol.."','"..defaultvCol.."','"..defaultvCol.."'" ) end if ( type( CheckPlayer7 ) == "table" and #CheckPlayer7 == 0 ) or not CheckPlayer7 then executeSQLInsert ( "LColors", "'"..serial.."','255','255','255'" ) end if ( type( CheckPlayer8 ) == "table" and #CheckPlayer8 == 0 ) or not CheckPlayer8 then executeSQLInsert ( "Colors", "'"..serial.."','"..defaultcCol.."','"..defaultnCol.."'" ) end if ( type( CheckPlayer9 ) == "table" and #CheckPlayer9 == 0 ) or not CheckPlayer9 then executeSQLInsert ( "RaceAttempts", "'"..serial.."','0'" ) end if ( type( CheckPlayer10 ) == "table" and #CheckPlayer10 == 0 ) or not CheckPlayer10 then executeSQLInsert ( "DDDM", "'"..serial.."','0','0'" ) end end addEvent("onClientReady",true) addEventHandler("onClientReady",getRootElement(),ClientReady) function giveCash(playerSource,giveCash,tPlayer,amount) if (isGuestAccount(getPlayerAccount(playerSource)) == false) then accountname = getAccountName (getPlayerAccount(playerSource)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then if not tPlayer or not amount then outputChatBox("ERROR: Syntax is /givecash [player] [amount]",255,0,0) return end if getPlayerFromName(tPlayer) == false then outputChatBox("Invalid Player Selected",playerSource,255,0,0) else local serial = getPlayerSerial(getPlayerFromName(tPlayer)) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") newMoney = tonumber(Money[1]["Money"]) + tonumber(amount) outputChatBox(getPlayerName(playerSource).." has given you $"..tonumber(amount),getPlayerFromName(tPlayer),255,255,0) executeSQLUpdate ( "MoneyB", "Money = '"..newMoney.."'","serial = '" .. serial .. "'") end end end end addCommandHandler("givecash",giveCash) function stats(psource,cname,tplayer) if not getPlayerFromName(tplayer) then tplayer = psource else tplayer = getPlayerFromName(tplayer) end achUnlockedNumber(tplayer) local serial = getPlayerSerial(tplayer) local RaceAttempts = executeSQLSelect ( "RaceAttempts", "RaceAttempts","serial = '" .. serial .. "'") local DDAttempts = executeSQLSelect ("DDDM","DDAttempts","serial = '" .. serial .. "'") local DDWins =executeSQLSelect ( "DDDM", "DDWins","serial = '" .. serial .. "'") local Wins1 = executeSQLSelect ( "RaceWins", "RaceWins","serial = '" .. serial .. "'") local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") local MoneyB = executeSQLSelect ( "MoneyB", "B","serial = '" .. serial .. "'") if tonumber(RaceAttempts[1]['RaceAttempts']) == 0 then ratio = 0 else ratio = (tonumber(Wins1[1]['RaceWins'])/tonumber(RaceAttempts[1]['RaceAttempts']))*100 end if tonumber(DDAttempts[1]['DDAttempts']) == 0 then rratio = 0 else rratio = (tonumber(DDWins[1]['DDWins'])/tonumber(DDAttempts[1]['DDAttempts']))*100 end outputChatBox(getPlayerName(tplayer).."'s Stats: Attempted: "..RaceAttempts[1]['RaceAttempts'].." races, "..DDAttempts[1]['DDAttempts'] .." DDs. Won: "..Wins1[1]['RaceWins'].." races("..ratio.."%), "..DDWins[1]['DDWins'].." DDs("..rratio.."%). Cash: $"..Money[1]['Money'].. " Unlocked "..getElementData(tplayer,"data.Achnum").."/9 Achievements("..MoneyB[1]['B'].."B)",root,173,218,068) end addCommandHandler("stats",stats) addCommandHandler("st",stats) function Ach1(playeer) local playername = getPlayerName(playeer) local serial = getPlayerSerial(playeer) local Ach1 = executeSQLSelect ( "Achievments", "Ach1","serial = '" .. serial .. "'") local AchB = executeSQLSelect ( "MoneyB", "B","serial = '" .. serial .. "'") local AchNumb = getElementData(playeer,"data.Achnum") Ach1 = tonumber(Ach1[1]["Ach1"]) + 1 if Ach1 == 50 then triggerClientEvent (playeer, "onAchUnlock", getRootElement()) AchB = tonumber(AchB[1]["B"]) + 30 setElementData(playeer, "B Points",AchB) executeSQLUpdate ( "MoneyB", "B = '"..AchB.."'","serial = '" .. serial .. "'") setElementData ( playeer ,"data.money",Money,true) setElementData ( playeer ,"data.AchB",AchB,true) outputChatBox("**Achievments: "..playername.." unlocked the achievment 'Pro Racer' for winning 50 races! (30B)",getRootElement(),255,100,0) AchNumb = tonumber(AchNumb) + 1 setElementData(playeer,"data.Achnum",AchNumb,true) end setElementData ( playeer ,"data.Ach1",Ach1,true) executeSQLUpdate ( "Achievments", "Ach1 = '"..Ach1.."'","serial = '" .. serial .. "'") end function raceWin(rank) if rank ~= 1 then --Check if the player's rank is 1 return end local playername = getPlayerName(source) local serial = getPlayerSerial(source) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") local Wins1 = executeSQLSelect ( "RaceWins", "RaceWins","serial = '" .. serial .. "'") Money = tonumber(Money[1]["Money"]) + get('MoneyForTheFirst') if get('ShowWinMessages') == "true" then triggerClientEvent (source,"onPlayerWin", getRootElement()) end setElementData (source, "Money" ,Money) setElementData ( source ,"data.money",Money,true) executeSQLUpdate ( "MoneyB", "Money = '"..Money.."'","serial = '" .. serial .. "'") outputChatBox("*Win: "..playername.." took $"..get('MoneyForTheFirst').." for finishing first!",getRootElement(),255,153,0) setElementData(source,"data.playername",playername,true) Wins1 = tonumber(Wins1[1]["RaceWins"]) + 1 setElementData ( source ,"race.Wins",Wins1,true) if get("Achievments") == 'true' then Ach1(source) end executeSQLUpdate ( "RaceWins", "RaceWins = '"..Wins1.."'","serial = '" .. serial .. "'") end function raceSec(rank) if rank ~= 2 then return end local playername = getPlayerName(source) local serial = getPlayerSerial(source) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") local Wins2 = executeSQLSelect ( "RaceWins", "RaceWins2","serial = '" .. serial .. "'") Money = tonumber(Money[1]["Money"]) + get('MoneyForTheSecond') outputChatBox("*Win: "..playername.." took $"..get('MoneyForTheSecond').." for finishing second!",getRootElement(),255,153,0) if get('ShowWinMessages') == "true" then triggerClientEvent (source,"onPlayerWin2", getRootElement()) end setElementData(source, "Money", Money) setElementData ( source ,"data.money",Money,true) setElementData(source,"data.playername",playername,true) Wins2 = tonumber(Wins2[1]["RaceWins2"]) + 1 setElementData ( source ,"race.Wins2",Wins2,true) executeSQLUpdate ( "MoneyB", "Money = '"..Money.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "RaceWins", "RaceWins2 = '"..Wins2.."'","serial = '" .. serial .. "'") end addEventHandler( "onPlayerFinish", rootElement, raceSec ) -- Race Wins function raceTh(rank) if rank ~= 3 then return end local playername = getPlayerName(source) local serial = getPlayerSerial(source) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") local Wins3 = executeSQLSelect ( "RaceWins", "RaceWins3","serial = '" .. serial .. "'") Money = tonumber(Money[1]["Money"]) + get('MoneyForTheThird') outputChatBox("*Win: "..playername.." took $"..get('MoneyForTheThird').." for finishing third!",getRootElement(),255,153,0) if get('ShowWinMessages') == "true" then triggerClientEvent (source,"onPlayerWin3", getRootElement()) end setElementData(source, "Money", Money) setElementData ( source ,"data.money",Money,true) setElementData(source,"data.playername",playername,true)
  8. So Pastebin is no good? Hmm, should I just give you the actual file?
  9. Haha sorry, figured this was answered before and had some answers. Posting it on Pastebin cause it's too much text on here. http://pastebin.com/zHSwHcXh
  10. Hi. Every time someone joins in the server this happens: If you need the script let me know cause it's huge.
  11. Hey your script worked. Thanks!
  12. I'll run the debug now. But it just repeated again.
  13. Ooh I see. Yea sorry, I understand now
  14. Hello. I'm starting to work on the script that I posted here and I need some help with 2 things: 1. Create a Notepad file that has the maps that will be updated everyday 2. The script to update the maps everyday. I'm working on getting the text displayed so if anyone can help make this OR show me some functions to use for the map updater, I'll do my best to try to script it (Cause I'm learning scripting ). Thanks in advance.
  15. Sorry if this is in the wrong section, I had no idea where to put this. I came up with an idea for mainly race servers. On the HUD there's a section saying "Map Recommendation of the Day" or something of that nature and shows a map randomly from the script. Basically in the script you can enter map names and if someone plays it gets an extra money bonus (example, if every map gives you $2500 for finishing first, the cash triples for playing the map recommendation of the day).
  16. Mossy

    HELP-ME!

    Can you edit it to put them in LUA tags? And how come there aren't any quotation marks in your message in the outputChatBox?
  17. Figured out what resource caused it. Here's a portion of the script with the onPlayerChat function: --- Chat & Name Color function chatNameColor(message,messageType) local color = getElementData (source, "info.namecolor") local color2 = getElementData(source, "info.chatcolor") local serial = getPlayerSerial(source) local playername = getPlayerName(source) if (color) and (color2) then outputChatBox(color..playername..": "..color2..message,getRootElement(),0,0,0,true) executeSQLUpdate ( "Colors", "Ncolor = '"..color.."'","serial = '" .. serial .. "'") executeSQLUpdate ( "Colors", "Ccolor = '"..color2.."'","serial = '" .. serial .. "'") else outputChatBox(playername..": "..message,getRootElement(),255,255,255,true) end end addEventHandler("onPlayerChat",getRootElement(),chatNameColor) function cancel() cancelEvent() end addEventHandler("onPlayerChat",getRootElement(),cancel) --- Cash !Command function PubMoney(message,messageType) if message == "!money" or message == "!cash" or message =="!Money" or message == "!Cash" then local serial = getPlayerSerial(source) local Money = executeSQLSelect ( "MoneyB", "Money","serial = '" .. serial .. "'") local name = getPlayerName(source) outputChatBox(name.." has $"..tonumber(Money[1]["Money"]),getRootElement(),255,255,0,true) end end addEventHandler("onPlayerChat",getRootElement(),PubMoney)
  18. I thought that too cause when I change my resolution they're all listed twice. I must have duplicated some files. Do you know where the chat file is located?
  19. Sorry for the double post but I found more. https://community.multitheftauto.com/ind ... ls&id=5423 He said to ignore it. https://community.multitheftauto.com/ind ... ils&id=692 Stole https://community.multitheftauto.com/ind ... ils&id=379 https://community.multitheftauto.com/ind ... ils&id=366 These two seem suspicious (read the comments) https://community.multitheftauto.com/ind ... ils&id=327 Description https://community.multitheftauto.com/ind ... ls&id=5408 Outdated https://community.multitheftauto.com/ind ... ls&id=5553 Deleted DONE
  20. Hello. I have a race server and whenever I type something in the chat it repeats itself. Like for example if I say Hi, it will look like I said Hi twice. Scripting error or should I re-download the race resource? Thanks in advance.
  21. https://community.multitheftauto.com/ind ... ls&id=2331 Description says he uploaded the wrong resource. https://community.multitheftauto.com/ind ... ls&id=2617 Umm... https://community.multitheftauto.com/ind ... ls&id=4872 Wrong one added. And by the way, can we also report outdated resources? I found a few of those too. DONE
×
×
  • Create New...