Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. If you do anything client side, only the localplayer would do what you want them to do(based on the client-side script!), so, if you put in a command for playing music, anyone would have access to it
  2. Jaysds1

    scoreboard

    lol, just use MTA's DB Functions: dbConnect dbQuery dbExec dbPoll not sure if I forgot more, but click on the function and the page should show you everything.
  3. lol, he said: try this: setTimer(function() for _,v in ipairs(getElementsByType("player"))do if getPlayerMoney(v)< 6000 then givePlayerMoney(v,100) end end end,300000,0)
  4. here, try this: --- Chat & Name Color function chatNameColor(message) if string.find(message,"!",1,true) then return end local color = getElementData (source, "info.namecolor") local color2 = getElementData(source, "info.chatcolor") local playername = getPlayerName(source) if (color) and (color2) then local serial = getPlayerSerial(source) outputChatBox(color..""..playername..": "..color2..""..message,root,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) if not string.find(message,"!",1,true) then return end message = string.lower(message) if 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)
  5. Jaysds1

    Question

    Wouldn't that output this: (Los Santos)Jaysds1: Hey ??? try this: addEventHandler("onPlayerChat",root,function(msg) cancelEvent() local x,y,z = getElementPosition(localPlayer) local zone = getZoneName(x,y,z,true) local curZone if zone=="Los Santos" then curZone = "LS" elseif zone == "Las Venturas" then curZone = "LV" elseif zone == "San Fierro" then curZone = "SF" else curZone = zone end outputChatBox("("..curZone..")"..getPlayerName(source)..":"..msg) end)
  6. Most likely, it's a bug from a recent update.
  7. Here: https://wiki.multitheftauto.com/wiki/Res ... scoreboard
  8. Hi all, This been happening for a while, but I forget to report it, anyways, I get this error every time I shut the server down:
  9. Do you mean like this: local word = "Tooky" --remove the last letter to make it say 'Took'
  10. I think this is a bug... Are you by any chance using a nightly?
  11. ya, there is a way, when you create a shortcut, simply type in mtasa://127.0.0.1:22003 then anytime you click on it, then you would automatically connect to a server. Here: http://imgur.com/a/U13Nb just finish creating the album, and please read the descriptions.
  12. None of these should have an impact on your server... Did you try restarting your computer? Did you try downloading MTA again?
  13. Here's an example of connecting to their mysql, here's your connection type: dbConnect( "mysql", "dbname=1347157507;host=free-mysql.BizHostNet.com;port=3306", "1347157507", "*****")
  14. ya,there's a way of turning it off automatically, I'll post the code here again. 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 if get("ghostmode") == 'true' then set("race.ghostmode","false") end local pcount = getPlayerCount() triggerClientEvent("onGMStop",root) if string.find(getMapName(), get('filterword'), 1, true) then outputDebugString("DD Detected, Halting the ghostmode voting.") 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 if get("ghostmode") == 'false' then set("ghostmode","true") end 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)
  15. sorry, I know this late but maybe you could use this free mysql hosting: http://www.bizhostnet.com/
  16. hmmm, maybe this would be better for you: https://wiki.multitheftauto.com/wiki/DxGUI
  17. Actually, I think you could use channels... Read more here: https://wiki.multitheftauto.com/wiki/Res ... yerChannel
  18. sorry, I really find i ridiculous to make another topic about the same thing... viewtopic.php?f=91&t=48141
  19. or you could check this wiki page out made by 50p https://wiki.multitheftauto.com/wiki/GUI_Classes
  20. Please read this: viewtopic.php?f=91&t=47897 and if you want to stop a function with out anymore scripts running, use return
  21. well, if you want to remove a specific item/model, you would need to stand by it and get the coordinate then insert it in your script.
  22. try this: 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.") 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) Please read comments
  23. can you post the url for the scripts please
×
×
  • Create New...