Jump to content

Memory

Members
  • Posts

    383
  • Joined

  • Last visited

Everything posted by Memory

  1. Hi, how can make function outputChatBox of this code for only one player? Now, message repeat many times. 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.."'") triggerClientEvent("onGMUpdate",getRootElement()) else outputChatBox("You have already voted for Ghostmode.",keyPresser,255,0,0) end end function success() local players = getElementsByType("player") for theKey,thePlayer in ipairs(players) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) outputChatBox("#B05555[Vote]#98FB98Ghostmode activated",root,255,255,255, true) end end addEvent("onVoteSuccess",true) addEventHandler("onVoteSuccess",getRootElement(),success) function failed() for k,v in ipairs(getElementsByType("player")) do outputChatBox("#B05555[Vote]#FF6A6AGhostmode deactivated",root,255,255,255, true) end end addEvent("onVoteFail",true) addEventHandler("onVoteFail",getRootElement(),failed)
  2. Work, thank you
  3. Thanks, TwiX! But doesn't save. 240 lines, setVehicleColor (playerVehicle,colorR,colorG,colorB); in function doSomethingForGuys() local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; local pVeh = getPedOccupiedVehicle(source); if pVeh then setVehicleColor (playerVehicle,colorR,colorG,colorB); end end addEventHandler("onNotifyPlayerReady",getRootElement(),doSomethingForGuys) Second error show after added function function doSomethikngFromPickUps(number,sort,model) local pVeh = getPedOccupiedVehicle(source); if isPedInVehicle (source) then local colorR = tonumber(getElementData(source,"cR")) or 0; local colorG = tonumber(getElementData(source,"cG")) or 0; local colorB = tonumber(getElementData(source,"cB")) or 0; setVehicleColor(pVeh,tonumber(colorR),tonumber(colorG),tonumber(colorB)); end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),doSomethikngFromPickUps)
  4. 1. Because, when vehicle change or change map, colour of car and light doesn't save. 2. This is server side. Client side, function lightColor () if source == redBar2 or source == greenBar2 or source == blueBar2 then local car = getPedOccupiedVehicle(getLocalPlayer()) setVehicleHeadLightColor(car, guiScrollBarGetScrollPosition(redBar2) * 2.55, guiScrollBarGetScrollPosition(greenBar2) * 2.55, guiScrollBarGetScrollPosition(blueBar2) * 2.55) end end addEventHandler("onClientGUIScroll", getRootElement(), lightColor) function carColor() if source == redBar2 or source == greenBar2 or source == blueBar2 then guiLabelSetColor(nickLabel2,(guiScrollBarGetScrollPosition(redBar2)*2.55),(guiScrollBarGetScrollPosition(greenBar2)*2.55),(guiScrollBarGetScrollPosition(blueBar2)*2.55)) end end addEventHandler("onClientGUIScroll",getRootElement(),carColor) function carCol() if source == carRedBar or source == carGreenBar or source == carBlueBar then triggerServerEvent("changeCarColor",getLocalPlayer(),(guiScrollBarGetScrollPosition(carRedBar)*2.55),(guiScrollBarGetScrollPosition(carGreenBar)*2.55),(guiScrollBarGetScrollPosition(carBlueBar)*2.55)) guiLabelSetColor(carLabel,(guiScrollBarGetScrollPosition(carRedBar)*2.55),(guiScrollBarGetScrollPosition(carGreenBar)*2.55),(guiScrollBarGetScrollPosition(carBlueBar)*2.55)) end end addEventHandler("onClientGUIScroll",getRootElement(),carCol)
  5. Hi, How can refresh colours of this code on "onMapStarting", "onPlayerPickUpRacePickup"? I tried to use, but doesn't work. function carColorChanger(carRedBar,carGreenBar,carBlueBar) playerVehicle = getPedOccupiedVehicle ( source ) if ( playerVehicle ) then setVehicleColor ( playerVehicle, carRedBar,carGreenBar,carBlueBar) end end addEvent("changeCarColor", true) addEventHandler("changeCarColor", rootElement,carColorChanger) function carLightsColorChanger(car, r, g, b) if ( car ) then setVehicleHeadLightColor (car, r, g, b) end end addEvent("changeLightsColor", true) addEventHandler("changeLightsColor", rootElement, carLightsColorChanger)
  6. Big thank you
  7. What next?
  8. Thanks, work
  9. Hi, how make command /gmon and /gmoff for moderators, smod and admins. gmontext = get("gmontext") gmoncolor = get("gmoncolor") gmofftext = get("gmofftext") gmoffcolor = get("gmoffcolor") addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), function(mapInfo) if string.find(mapInfo.name, "[DM]", 1, true) or mapInfo.modename == "Sprint" then gmon() else gmoff() end end) function gmon() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) outputChatBox(gmoncolor..gmontext,thePlayer,186,212,71,true) end end addCommandHandler("gmon", gmon) function gmoff() for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmoffcolor..gmofftext,thePlayer,255,255,255,true) end end addCommandHandler("gmoff", gmoff) This don't work function gmon() acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData( thePlayer, "overrideCollide.uniqueblah", 0, false ) outputChatBox(gmoncolor..gmontext,thePlayer,186,212,71,true) end end addCommandHandler("gmon", gmon) function gmoff() acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then for theKey,thePlayer in ipairs(getElementsByType("player")) do setElementData(thePlayer, "overrideCollide.uniqueblah", nil, false ) outputChatBox(gmoffcolor..gmofftext,thePlayer,255,255,255,true) end end addCommandHandler("gmoff", gmoff)
  10. Worked outputChatBox("Maps Shop Loaded",255,255,0) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(701,328,584,394,"Map Shop",false) GUIEditor_Image[1] = guiCreateStaticImage(11,19,564,366,"back.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(273,13,289,21,"Money:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[1],0,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(270,75,284,70,"A Map Costs 5000$",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,0) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Button[1] = guiCreateButton(280,264,265,91,"Buy Map [ -5000 ]",false,GUIEditor_Image[1]) GUIEditor_Label[3] = guiCreateLabel(272,36,252,19,"Map Status:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,0) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(286,211,252,45,"Map",false,GUIEditor_Image[1]) GUIEditor_Label[4] = guiCreateLabel(293,170,233,37,"Selected Map:",false,GUIEditor_Image[1]) guiLabelSetColor(GUIEditor_Label[4],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[4],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[4],"center",false) guiSetFont(GUIEditor_Label[4],"default-bold-small") mapGridList = guiCreateGridList(3,5,254,357,false,GUIEditor_Image[1]) guiGridListSetSelectionMode(mapGridList,2) mapsColumn = guiGridListAddColumn(mapGridList,"Maps",0.85) guiGridListSetSelectionMode(mapGridList,2) guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) function onresourceStart () bindKey ("F1", "down", showPanel) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function showPanel () getVisible = guiGetVisible (GUIEditor_Window[1]) playerName = getPlayerName ( getLocalPlayer() ) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) guiSetVisible (GUIEditor_Image[1], false) showCursor (false) end if (getVisible == false) then triggerServerEvent ( "dannyevent", getRootElement()) guiSetVisible (GUIEditor_Window[1], true) guiSetVisible (GUIEditor_Image[1], true) showCursor (true) local playerMoney = getPlayerMoney(source) guiSetText ( GUIEditor_Label[1], "Money: [ " .. playerMoney .. " ]" ) end end
  11. Hi, Can you are help me with maps shop for race? With what to begin first?
  12. Memory

    Anti vote spam

    This scripts only for stoped spam of number, when continues vote.
  13. Memory

    Anti vote spam

    Thanks, work I still added "addEvent("onRaceStateChanging",true)" for all unmuted. Full code, add resource name to acl "Admin", function mutePlayers() for _, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerMuted(player, true) outputChatBox("#FF0000All has been muted.",player, 255, 255, 255, true ) end end addEvent("onPollStarting",true) addEventHandler("onPollStarting",root, mutePlayers) function unmutePlayers(state) for _, player in ipairs ( getElementsByType ( "player" ) ) do if state=="LoadingMap" then setPlayerMuted(player, false) outputChatBox("#FF0000All has been unmuted.",player, 255, 255, 255, true ) end end end addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, unmutePlayers)
  14. Memory

    Anti vote spam

    Yes, for race.
  15. Memory

    Anti vote spam

    Can be this? But don't work function mutePlayers() for _, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerMuted(player, true) outputChatBox("#FF0000All has been muted.",player, 255, 255, 255, true ) end end addEventHandler("onPollStarting",root, mutePlayers) function unmutePlayers(state) for _, player in ipairs ( getElementsByType ( "player" ) ) do if state=="LoadingMap" then setPlayerMuted(player, false) outputChatBox("#FF0000All has been unmuted.",player, 255, 255, 255, true ) end end addEventHandler("onRaceStateChanging",root, unmutePlayers)
  16. Memory

    Anti vote spam

    Sure, I add, now command work, but on vote start don't work
  17. Memory

    Anti vote spam

    Don't work. Only on command "mute" work outputChatBox, but not muted.
  18. Hi, Can you are help with anti vote spam? How activated "function mutePlayer" on started vote for change map, and "function UnmutePlayer" on stop vote? function mutePlayer() for _, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerMuted(player, true) outputChatBox("#FF0000All has been muted.", getRootElement(), 255, 255, 255, true ) end for i,v in ipairs(getAccounts()) do setPlayerMuted(v, true) end addCommandHandler("mute",mutePlayer) function UnmutePlayer() for _, player in ipairs ( getElementsByType ( "player" ) ) do setPlayerMuted(player, false) outputChatBox("#FF0000All has been unmuted.", getRootElement(), 255, 255, 255, true ) end for i,v in ipairs(getAccounts()) do setPlayerMuted(v, false) end addCommandHandler("unmute",UnmutePlayer)
  19. Memory

    Get points

    Thanks, work function check() local alive = getAlivePlayers() local player = alive[1] local acc = getPlayerAccount( player ) local ptzData = getAccountData( acc, "Points" ) if (#alive == 1) then local playerCount = getPlayerCount() local pointsToWin = playerCount *10 if ptzData then setAccountData( acc, "Points", ptzData + pointsToWin ) else setAccountData( acc, "Points", pointsToWin ) end outputChatBox("#FF9900[Points]#FFFFFF " .. getPlayerName(player).. " #00FF00 receive "..pointsToWin, getRootElement(), 255, 255, 255, true ) end end addEventHandler("onPlayerWasted",getRootElement(),check)
  20. Memory

    Get points

    Hi, have problem with points system, point in DM, DD maps got second player, not winner. Code function check() local alive = getAlivePlayers() local acc = getPlayerAccount( source ) local ptzData = getAccountData( acc, "Points" ) if (#alive == 1) then local player = alive[1] local playerCount = getPlayerCount() local pointsToWin = playerCount *10 if ptzData then setAccountData( acc, "Points", ptzData + pointsToWin ) else setAccountData( acc, "Points", pointsToWin ) end outputChatBox("#FF9900[Points]#FFFFFF " .. getPlayerName(player).. " #00FF00 receive "..pointsToWin, getRootElement(), 255, 255, 255, true ) end end addEventHandler("onPlayerWasted",getRootElement(),check) For money work, money got winner function check() local alive = getAlivePlayers() if (#alive == 1) then local player = alive[1] givePlayerMoney(player,300) outputChatBox("#FFFFFF"..getPlayerName(player).." #00FF00has earned $300 for being the last player alive",getRootElement(),255,255,255, true) end end addEventHandler("onPlayerWasted",getRootElement(),check)
  21. Memory

    Points send

    Thank you are, but I not professional in lua and php. I think, that this will more easy function
  22. Memory

    Points send

    Hello, how can send a top points and money to website from server? (preferably in html)
  23. Memory

    Reset points

    Thanks
  24. Memory

    Help, please.

    You would like to ban moderators open ACL? ...\server\mods\deathmatch\ACL.xml, open through notepad, found "" ---> ""
  25. Memory

    Reset points

    Again problem with it. Points is reseted for only a players, who is online.
×
×
  • Create New...