Mossy Posted September 26, 2012 Share Posted September 26, 2012 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. Link to comment
HunT Posted September 27, 2012 Share Posted September 27, 2012 Search other system Race_starter have many bugs ( I remember this in my server 2010) If u use the /roll and risultate is mute for 30 sec. Is false Mute forever The color setting is old style and don't save in database. And many others bugs. Link to comment
Mossy Posted September 27, 2012 Author Share Posted September 27, 2012 Search other system Race_starter have many bugs ( I remember this in my server 2010) If u use the /roll and risultate is mute for 30 sec. Is false Mute forever The color setting is old style and don't save in database. And many others bugs. Yeah you're right, I'll either make my own or find another one By the way, nice Shelby in your avatar. 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