Mossy Posted September 26, 2012 Share Posted September 26, 2012 Hi. Every time someone joins in the server this happens: If you need the script let me know cause it's huge. Link to comment
Castillo Posted September 26, 2012 Share Posted September 26, 2012 Of course we need it, how are we going to help if we don't have it? Link to comment
Mossy Posted September 26, 2012 Author Share Posted September 26, 2012 Of course we need it, how are we going to help if we don't have it? 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 Link to comment
Castillo Posted September 26, 2012 Share Posted September 26, 2012 All the error line numbers are wrong, none of them is the right one at the pastebin code. Link to comment
Mossy Posted September 26, 2012 Author Share Posted September 26, 2012 All the error line numbers are wrong, none of them is the right one at the pastebin code. So Pastebin is no good? Hmm, should I just give you the actual file? Link to comment
Castillo Posted September 26, 2012 Share Posted September 26, 2012 Post the code from line: 1 to 500. Link to comment
Mossy Posted September 26, 2012 Author Share Posted September 26, 2012 --- --- --- --- --- --- --- --- --- --- --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) Link to comment
Castillo Posted September 26, 2012 Share Posted September 26, 2012 They don't match either, the line numbers are still wrong, though I may be able to fix them anyway. http://pastebin.com/83v3g8N6 Replace from line 1 to 500 in your complete script. Link to comment
Mossy Posted September 26, 2012 Author Share Posted September 26, 2012 Another question. Does this problem affect the login or just a usual script bug? Link to comment
Castillo Posted September 26, 2012 Share Posted September 26, 2012 If I'm right, these errors we're there when the player was not on the table(s). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now