Jump to content

naotriix

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by naotriix

  1. ❆ MERRY CHRISTMAS ❆ Hey guys, I'm here to present you an edited version of my v2 "IGGY IGGY" and it is called "IGGY XMAS". Furthermore it's a featuring with LaZZ and we worked whole yesterday night to create this version. Moreover LaZZ fixed every bug of my v2 to make this new version more playable and smooth Ps: This is my first record Download Link: http://www.mediafire.com/file/nn9nhqo7qgmko59/[DM]NaoftLazz-iggyxmas.zip //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Song name : ❆ Frozen - Let It Go (Fallen Superhero Remix) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Credits: ❆ Lights & Wheels by RuguxS's ❆ Infernus by Micra v5 Unique Spoiler No Plate ❆ Ultrathing 0.29a //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Social networks: ❆ TFF Website: - http://www.thefavouredfew.com ❆ Skype - naomta Best Regards Nao.#
  2. Hey, Je recherche un scripter pour développer les choses suivantes: (J'ai déjà un loginpanel qui utilise les comptes de mon forum ipboard pour se connecter). (J'ai le design du lobby déjà fait). Un multigamemode avec lobby avec les gamemodes suivants: - DM sépare en 3 rooms: DM / OS / HDM - Hunter - DD - Race - Shooter - Training Un userpanel avec les features de base: stats / settings / map shop / carshop / donator / achievements, events automatiques, système de pvp... Stats sauvegardées dans une bdd mysql. Système de notifications / toptimes / team manager style ffsgaming / script de dj en streaming ou avec liens youtube... Si quelqu'un ce sent déterminé, on peut discuté prix etc... Cordialement
  3. Eye For An Eye est un clan crée en 2013 par Reacerr Et Shockwave, nous l'avons ré-ouvert en fevrier 2015, nous comptons maintenant une 30ene de membres actifs de toutes nationalités. Main DM/Hunter Server: Ip: mtasa://www.efe-clan.com:22003 OS Server: IP: mtasa://www.efe-clan.com:22063 Training Server: IP: mtasa://www.efe-clan.com:22013 Website: http://www.efe-clan.com Facebook: https://www.facebook.com/eyeforaneyegaming Cordialement Nao.#
  4. Je crois que le mieux serait que je te file l'userpanel pour que tu m'explique car c'est le bordel, y a plusieurs fichiers avec des buttons dedans etc.
  5. Merci pour le code mais je ne comprend pas tellement comment m'y prendre pour l'utiliser Le button est crée avec ca si j'ai bien compris: dxLibCreateButton(cInterface.tab_3.dxElements.buttons[3],positionX+sX*0.6,positionY+sY*0.37,sX*0.3,sY*0.06,"Buy selected color as #1 vehicle color",sY/500,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) dxLibCreateButton(cInterface.tab_3.dxElements.buttons[4],positionX+sX*0.6,positionY+sY*0.74,sX*0.3,sY*0.06,"Buy selected color as #2 vehicle color",sY/500,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) Si je suis ton code cela donnerais: local cInterface.tab_3.dxElements.buttons[3] = createElement("dxButton") function renderTest() dxLibCreateButton(cInterface.tab_3.dxElements.buttons[3],positionX+sX*0.6,positionY+sY*0.37,sX*0.3,sY*0.06,"Buy selected color as #1 vehicle color",sY/500,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) end addEventHandler("onClientRender", root, renderTest) Mais ou dois-je place le remove ensuite ? Pourrais tu me faire un exemple complet pour que je puisse mieux comprendre --<<<<< Vehicle colors drawColorPickerInterface(positionX+sX*0.1,positionY+sY*0.3) dxDrawText("Pick your new vehicle color!",positionX+sX*0.1,positionY+sY*0.1,positionX+sX*0.55+2,positionY+sY*0.25+2,tocolor(0,0,0,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxDrawText("Pick your new vehicle color!",positionX+sX*0.1,positionY+sY*0.1,positionX+sX*0.55,positionY+sY*0.25,tocolor(220,220,220,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxLibCreateButton(cInterface.tab_3.dxElements.buttons[3],positionX+sX*0.6,positionY+sY*0.37,sX*0.3,sY*0.06,"Buy selected color as #1 vehicle color",sY/500,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) dxLibCreateButton(cInterface.tab_3.dxElements.buttons[4],positionX+sX*0.6,positionY+sY*0.74,sX*0.3,sY*0.06,"Buy selected color as #2 vehicle color",sY/500,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) dxDrawText("First vehicle color",positionX+sX*0.6,positionY+sY*0.1,positionX+sX*0.9+2,positionY+sY*0.25+2,tocolor(0,0,0,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxDrawText("First vehicle color",positionX+sX*0.6,positionY+sY*0.1,positionX+sX*0.9,positionY+sY*0.25,tocolor(220,220,220,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxDrawText("Second vehicle color",positionX+sX*0.6,positionY+sY*0.52,positionX+sX*0.9+2,positionY+sY*0.57+2,tocolor(0,0,0,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxDrawText("Second vehicle color",positionX+sX*0.6,positionY+sY*0.52,positionX+sX*0.9,positionY+sY*0.57,tocolor(220,220,220,255*menu.alpha),s(0.3),menu.font,"center","center",true,false,menu.postGUI) dxDrawRectangle(positionX+sX*0.6,positionY+sY*0.3,sX*0.14,sY*0.06,tocolor(cInterface.tab_3.vehicleColors.data[1][1],cInterface.tab_3.vehicleColors.data[1][2],cInterface.tab_3.vehicleColors.data[1][3],255*menu.alpha),menu.postGUI) dxLibCreateButton(cInterface.tab_3.dxElements.buttons[5],positionX+sX*0.75,positionY+sY*0.3,sX*0.15,sY*0.06,"Sell color +$5000",sY/550,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) dxDrawText("State: "..cInterface.tab_3.vehicleColors.state[1],positionX+sX*0.6,positionY+sY*0.25,positionX+sX*0.9+2,positionY+sY*0.3+2,tocolor(0,0,0,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("State: "..cInterface.tab_3.vehicleColors.state[1],positionX+sX*0.6,positionY+sY*0.25,positionX+sX*0.9,positionY+sY*0.3,tocolor(220,220,220,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("Price: $"..cInterface.tab_3.vehicleColors.price[1],positionX+sX*0.6,positionY+sY*0.22,positionX+sX*0.9+2,positionY+sY*0.27+2,tocolor(0,0,0,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("Price: $"..cInterface.tab_3.vehicleColors.price[1],positionX+sX*0.6,positionY+sY*0.22,positionX+sX*0.9,positionY+sY*0.27,tocolor(220,220,220,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawRectangle(positionX+sX*0.6,positionY+sY*0.67,sX*0.14,sY*0.06,tocolor(cInterface.tab_3.vehicleColors.data[2][1],cInterface.tab_3.vehicleColors.data[2][2],cInterface.tab_3.vehicleColors.data[2][3],255*menu.alpha),menu.postGUI) dxLibCreateButton(cInterface.tab_3.dxElements.buttons[6],positionX+sX*0.75,positionY+sY*0.67,sX*0.15,sY*0.06,"Sell color +$5000",sY/550,136,0,0,220,220,220,menu.alpha*255,menu.postGUI,false) dxDrawText("State: "..cInterface.tab_3.vehicleColors.state[2],positionX+sX*0.6,positionY+sY*0.62,positionX+sX*0.9+2,positionY+sY*0.67+2,tocolor(0,0,0,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("State: "..cInterface.tab_3.vehicleColors.state[2],positionX+sX*0.6,positionY+sY*0.62,positionX+sX*0.9,positionY+sY*0.67,tocolor(220,220,220,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("Price: $"..cInterface.tab_3.vehicleColors.price[2],positionX+sX*0.6,positionY+sY*0.59,positionX+sX*0.9+2,positionY+sY*0.64+2,tocolor(0,0,0,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) dxDrawText("Price: $"..cInterface.tab_3.vehicleColors.price[2],positionX+sX*0.6,positionY+sY*0.59,positionX+sX*0.9,positionY+sY*0.64,tocolor(220,220,220,255*menu.alpha),s(0.2),menu.font,"left","center",true,false,menu.postGUI) end
  6. function dxLibCreateButton(buttonElement,positionX,positionY,sizeX,sizeY,buttonLabel,labelSize,red,green,blue,lR,lG,lB,alpha,postGUI,coloredLabel) if not getElementData(buttonElement,"dxButtonCreate") then setElementData(buttonElement,"dxButtonCreate",true,false) setElementData(buttonElement,"dxButtonHover",false,false) setElementData(buttonElement,"dxButtonClick",false,false) return end setElementData(buttonElement,"dxButtonLabel",tostring(buttonLabel),false) setElementData(buttonElement,"dxButtonHover",false,false) local scaleX = sizeX/932 if isCursorHover(positionX,positionY,sizeX,sizeY) and not getElementData(buttonElement,"dxButtonClick") then setElementData(buttonElement,"dxButtonHover",true,false) dxDrawImageSection(positionX-25*scaleX+sizeX,positionY,25*scaleX,sizeY,0,0,25,174,dxLib.imageURL.."button.png",180,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) dxDrawImageSection(positionX,positionY,25*scaleX,sizeY,907,0,25,174,dxLib.imageURL.."button.png",180,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) dxDrawImageSection(positionX+25*scaleX,positionY,sizeX-50*scaleX,sizeY,26,0,1,174,dxLib.imageURL.."button.png",180,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX+1,positionY+sizeY+2,tocolor(0,0,0,alpha*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX,positionY+sizeY,tocolor(lR,lG,lB,alpha*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) else dxDrawImageSection(positionX,positionY,25*scaleX,sizeY,0,0,25,174,dxLib.imageURL.."button.png",0,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) dxDrawImageSection(positionX-25*scaleX+sizeX,positionY,25*scaleX,sizeY,907,0,25,174,dxLib.imageURL.."button.png",0,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) dxDrawImageSection(positionX+25*scaleX,positionY,sizeX-50*scaleX,sizeY,26,0,1,174,dxLib.imageURL.."button.png",0,0,0,tocolor(70,70,70,255*dxLib.globalAlpha),postGUI) if not getElementData(buttonElement,"dxButtonClick") then dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX+1,positionY+sizeY+2,tocolor(0,0,0,alpha*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX,positionY+sizeY,tocolor(lR,lG,lB,alpha*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) else dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX+1,positionY+sizeY+2,tocolor(0,0,0,alpha/1.2*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) dxDrawText(buttonLabel,positionX,positionY,positionX+sizeX,positionY+sizeY,tocolor(lR,lG,lB,alpha/1.2*dxLib.globalAlpha),labelSize,dxLib.font,"center","center",true,false,postGUI,coloredLabel or false) end end setElementData(buttonElement,"dxButtonClick",false,false) end Je pense que ca ce situe ici, j'ai changer a la ligne 12. setElementData(buttonElement,"dxButtonHover",true,false) en setElementData(buttonElement,"dxButtonHover",false,false) et plus aucuns boutons ne fonctionnaient, je te met le code entier pour que tu es un meilleur aperçu.
  7. Bonjour, voila depuis quelque temps j'utilise un userpanel très bien, mais un bug résiste, si j'ai bien compris cela viendrait du fait qu'a chaque fois que le curseur est visible et que l'on clique n'importe ou, le dernier boutton utilisé dans l'userpanel sa réactive. Par exemple; dans l'onglet settings de mon userpanel il y a un shader que l'on peut activé ou désactivé, si je l'active et que ensuite je lance l'adminpanel et que je clique nimporte ou, puisque le curseur est visible, le button de l'userpanel se déclenche sans qu'il soit ouvert, après quelques recherches je pense que le soucis viens de cette endroit: function onDxLibPlayerClick(button,state) if isCursorShowing() then if button == "left" and state == "down" then for i,dxButton in pairs(getElementsByType("dxButton")) do if getElementData(dxButton,"dxButtonHover") then setElementData(dxButton,"dxButtonClick",true,false) triggerEvent("onDxLibButtonClick",getRootElement(),dxButton) outputDebugString("Triggering event: \"onDxLibButtonClick\"",0,100,100,100) setElementData(dxButton,"dxButtonHover",false,false) end end for i,dxGridlist in pairs(getElementsByType("dxGridlist")) do if getElementData(dxGridlist,"dxGridlistHover") then if getElementData(dxGridlist,"dxGridlistDataHover") then setElementData(dxGridlist,"dxGridlistSelected",tonumber(getElementData(dxGridlist,"dxGridlistDataHover")),false) triggerEvent("onDxLibGridlistClick",getRootElement(),dxGridlist) end elseif getElementData(dxGridlist,"dxGridlistScrollHover") then setElementData(dxGridlist,"dxGridlistScrollClicked",true,false) end end for i,dxEdit in pairs(getElementsByType("dxEdit")) do if getElementData(dxEdit,"dxEditHover") then setElementData(dxEdit,"dxEditActive",true,false) setElementData(dxEdit,"dxEditSelected",false,false) elseif getElementData(dxEdit,"dxEditActive") and not getElementData(dxEdit,"dxEditHover") then setElementData(dxEdit,"dxEditActive",false,false) end end end end end addEventHandler("onClientClick",getRootElement(),onDxLibPlayerClick) Je voudrais que lorsque l'on clique ailleur de sur le bouton ca ne l'active/désactive plus. Si quelqu'un peut m'aider, j'ai beau chercher je n'arrive pas a régler ce soucis assez génant.
  8. Ok, je t'envoie sa en mp. J'ai remis le race voting de base avec le voteredo dedans.
  9. sinon j'ai un autre voteredo, celui ci redo bien la map mais du coup y faut refaire les changements car il vire le map queue: -------------------------VOTE REDO----------------------------- local votesRedo = 0 local allowRedo = false local lastMap = "" local requiredVotes = 100 local reqFlag = false local votedPlayers = {} addEvent("onMapStarting", true) function onMapStartResset() votedPlayers = {} if g_ForcedNextMap == false then triggerEvent("onMapSuccessfullyStart", getRootElement()) end end addEventHandler("onMapStarting", getRootElement(), onMapStartResset) function addVotedPlayers(player) votedPlayers[#votedPlayers+1] = getPlayerSerial(player) end function checkVotedPlayer(player) for i=1,#votedPlayers do if (getPlayerSerial(player) == votedPlayers[i])then return true end end return false end function voteRedoManagment(player) if not(checkVotedPlayer(player))then local currentMap = getMapName(exports.mapmanager:getRunningGamemodeMap()) if allowRedo then outputChatBox("#551A8B* #ffffffThis #ff0000Map #ffffffis going to be #ff0000restarted.", player, 255,255,255,true) return end if not(reqFlag)then requiredVotes = tonumber(math.ceil((getPlayerCount()/2))) reqFlag = true end if not(currentMap == lastMap)then votesRedo = votesRedo + 1 addVotedPlayers(player) outputChatBox("#551A8B* #FFFFFFRedo #ff0000votes: (#ff0000"..votesRedo.."#FFFFFF/#ff0000"..requiredVotes.."#FFFFFF) (".. "#ffffff" ..''.. getPlayerName(player)..'#FFFFFF)', getRootElement(), 255, 80, 0, true) if(votesRedo >= requiredVotes)then allowRedo = true end else outputChatBox("#551A8B* #FFFFFFThis #ff0000Map #ffffffwas already #ff0000restarted.", player, 255,255,255,true) end else outputChatBox("#551A8B* #FFFFFFYou Have already #ff0000voted.", player, 255,255,255,true) end end addCommandHandler("voteredo", voteRedoManagment) addCommandHandler("vr", voteRedoManagment) addEventHandler("onMapStarting", getRootElement(), function() votesRedo = 0 allowRedo = false reqFlag = false end) function onGridCountDown (stateName) if stateName == "PostFinish" then lastMap = getMapName(exports.mapmanager:getRunningGamemodeMap()) if(allowRedo)then setTimer(function() voteRedoMap() outputChatBox('#ff0000* #FFFFFFRestarted By #ff0000Vote.', getRootElement(), 255, 80, 0, true) end,500, 1) end end end addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging", getRootElement(), onGridCountDown) --voteRedo function voteRedoMap() local currentMap = exports.mapmanager:getRunningGamemodeMap() if currentMap then if not exports.mapmanager:changeGamemodeMap (currentMap, nil, true) then problemChangingMap() end else outputRace("You can't restart the map because no map is running", getRootElement()) end end
  10. Tu as raison c'est du server, sinon j'ai rajouté la ligne rien ne s'affiche dans la console ni dans le debugscript 2.
  11. Salut, alors le fichier se trouver dans l'userpanel, il s'appelle map_queue.lua donc oui surement client. Je peux t'upload tout le dossier si tu le souhaite aisi que le race, sinon voila le code en entier du fichier: local mapQueue = {} local mapTimers = {} local randomMap = 0 local specialMapCost = 5000 mapBuyDelay = 35 -- Here delay in minutes function addMapToQueue(thePlayer,resourceName) if isPlayerLogged(thePlayer) then local playerCash = getPlayerData(thePlayer,'cash') if playerCash>=shopPrice.map then local errorCode = false if #mapQueue ~= 0 then for i,tableQ in pairs(mapQueue) do if tableQ[4] == resourceName then errorCode = 1 break elseif tableQ[3] == thePlayer then errorCode = 2 break end end end if errorCode then if errorCode == 1 then return displayNotification(thePlayer,"Map queue","This map is already in map queue!",0,100,255) elseif errorCode == 2 then return displayNotification(thePlayer,"Map queue","You have one map in map queue now!",0,100,255) end end local mapQueueTable = {} local map = getResourceFromName(resourceName) if map then local mapQueueTable = { getResourceInfo(map, "name") or resourceName, getPlayerName(thePlayer), thePlayer, resourceName } if not mapTimers[mapQueueTable[4]] then if string.find(mapQueueTable[1],"DD",1) or string.find(mapQueueTable[1],"FUN",1) then if playerCashthen return displayNotification(thePlayer,"Map queue","You dont have enough cash! (Need: $"..specialMapCost..")",0,100,255) end addValue(thePlayer,'specialMaps',1) addValue(thePlayer,'cash',-specialMapCost) else addValue(thePlayer,'cash',-shopPrice.map) addValue(thePlayer,'mapsBought',1) end table.insert(mapQueue,mapQueueTable) if #mapQueue == 1 then triggerEvent("onUserpanelWantNextmap",getRootElement(),mapQueue[1]) end mapTimers[mapQueueTable[4]] = setTimer(resetMapTimer,mapBuyDelay*60000,1,mapQueueTable[4]) displayNotification(thePlayer,"Map queue","You successfully add new map to map queue!",0,100,255) outputChatBox("#0088FF[MAP] #ffffff"..getPlayerName(thePlayer).." #ffffffadd# {colorCode}"..mapQueueTable[1].."#ffffff to map queue.",getRootElement(),255,255,255,true) refreshScoreboard(thePlayer) checkAchievements(thePlayer,4) checkAchievements(thePlayer) else if isTimer(mapTimers[mapQueueTable[4]]) then local rem = getTimerDetails(mapTimers[mapQueueTable[4]]) local rem = math.ceil(rem/60000) displayNotification(thePlayer,"Map queue","You can set this map in: "..rem.." minutes.",0,100,255) end end else displayNotification(thePlayer,"Map queue","Cant find a map!",0,100,255) end else displayNotification(thePlayer,"Map queue","You dont have enough cash!",0,100,255) end end sentMapQueueToClients() end addEvent("onRaceCallNextMapCommand",true) addEventHandler("onRaceCallNextMapCommand",getRootElement(),addMapToQueue) function resetMapTimer(mapString) if isTimer(mapTimers[mapString]) then killTimer(mapTimers[mapString]) end mapTimers[mapString] = nil end function sentMapQueueToClients() callClientFunction(getRootElement(),"updateMapQueue",mapQueue) end function updateMapQueueOnMapStart() randomMap = randomMap + 1 if randomMap ~= 4 then if #mapQueue ~= 0 then if not votedForRedo then table.remove(mapQueue, 1) end votedForRedo = false if #mapQueue > 1 then triggerEvent("onUserpanelWantNextmap", getRootElement(), mapQueue[1]) outputDebugString("Calling next map to race", 1, 255, 255, 255) end end else randomMap = 0 triggerEvent("onUserpanelWantNextmap", getRootElement(), 'Random map') end sentMapQueueToClients() end addEvent("onRaceCallNextMap", true) addEventHandler("onRaceCallNextMap", getRootElement(), updateMapQueueOnMapStart) local votedForRedo = false addEvent("onVoteRedoSuccess", true) function applyVoteRedo() votedForRedo = true outputChatBox("[REDO] The map will be replayed !", 200, 0, 0) end addEventHandler("onVoteRedoSuccess", root, applyVoteRedo) --- VR --- addEvent("onMapStarting", true) function clearVote() playersVoted = 0 mapRestarting = false for i,playersVR in ipairs(getElementsByType ("player")) do setElementData( playersVR, "hasVoted", "nope" ) end end addEventHandler("onClientResourceStart", resourceRoot, clearVote) addEventHandler("onMapStarting", root, clearVote) function voteRedo(thePlayer) if not mapRestarting then if (getElementData(thePlayer, "hasVoted" ) == "nope") then setElementData(thePlayer, "hasVoted", "voted" ) playersVoted = playersVoted + 1 local rr,gg,bb = 255,0,0 if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then rr,gg,bb = 0,255,0 end outputChatBox("' ["..playersVoted.."/".. math.floor(getPlayerCount() /2 + 0.5) .."] ' #1a5eaa~> #c1c1c1Voted For Redo ( #FFFFFF"..getPlayerNametagText(thePlayer).." #C1C1C1)", root, rr, gg, bb, true) if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then applyVoteRedo() mapRestarting = true outputChatBox ("#c1c1c1This Map Will Be Restarted By #1a5eaaVote", root, 255, 153, 0, true) end else outputChatBox("#c1c1c1You already #1a5eaaVoted #FFFFFFfor redo !", thePlayer, 255, 0, 0, true) end else outputChatBox("#440000Sorry#ffffff, #c1c1c1This map was restarted by #1a5eaaVote #FFFFFF!", thePlayer, 255, 0, 0, true) end end addCommandHandler("vr", voteRedo, false, false) addCommandHandler("voteredo", voteRedo, false, false) ------
  12. J'ai effectué le changement toujours la meme erreur la ligne qui pose pb playersVoted = playersVoted + 1
  13. Je viens d'ajouter le not maintenant la commande s'affiche mais sa ne redo pas la map. En debug script sa me met: ERROR: map_queue.lua:138 attempt to perform arthmetic on global 'playersVoted' (a nil value) et aussi: Warning: core_server.lua:1027 bad argument @ 'outputchatbox' expected element at argument 2, got number 200 _outputChatBox(chatString,theElement,colorTable[1],colorTable[2],colorTable[3],true) la ligne.
  14. Voila le code en entier, je te met aussi le race_voting ca peut peut etre se jouer le dedans. function updateMapQueueOnMapStart() randomMap = randomMap + 1 if randomMap ~= 4 then if #mapQueue ~= 0 then if not votedForRedo then table.remove(mapQueue, 1) end votedForRedo = false if #mapQueue > 1 then triggerEvent("onUserpanelWantNextmap", getRootElement(), mapQueue[1]) outputDebugString("Calling next map to race", 1, 255, 255, 255) end end else randomMap = 0 triggerEvent("onUserpanelWantNextmap", getRootElement(), 'Random map') end sentMapQueueToClients() end addEvent("onRaceCallNextMap", true) addEventHandler("onRaceCallNextMap", getRootElement(), updateMapQueueOnMapStart) local votedForRedo = false addEvent("onVoteRedoSuccess", true) function applyVoteRedo() votedForRedo = true outputChatBox("[REDO] The map will be replayed !", 200, 0, 0) end addEventHandler("onVoteRedoSuccess", root, applyVoteRedo) --- VR --- addEvent("onMapStarting", true) function clearVote() playersVoted = 0 mapRestarting = false for i,playersVR in ipairs(getElementsByType ("player")) do setElementData( playersVR, "hasVoted", "nope" ) end end addEventHandler("onClientResourceStart", resourceRoot, clearVote) addEventHandler("onMapStarting", resourceRoot, clearVote) function voteRedo(thePlayer) if mapRestarting then if (getElementData(thePlayer, "hasVoted" ) == "nope") then setElementData(thePlayer, "hasVoted", "voted" ) playersVoted = playersVoted + 1 local rr,gg,bb = 255,0,0 if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then rr,gg,bb = 0,255,0 end outputChatBox("' ["..playersVoted.."/".. math.floor(getPlayerCount() /2 + 0.5) .."] ' #1a5eaa~> #c1c1c1Voted For Redo ( #FFFFFF"..getPlayerNametagText(thePlayer).." #C1C1C1)", root, rr, gg, bb, true) if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then applyVoteRedo() mapRestarting = true outputChatBox ("#c1c1c1This Map Will Be Restarted By #1a5eaaVote", root, 255, 153, 0, true) end else outputChatBox("#c1c1c1You already #1a5eaaVoted #FFFFFFfor redo !", thePlayer, 255, 0, 0, true) end else outputChatBox("#440000Sorry#ffffff, #c1c1c1This map was restarted by #1a5eaaVote #FFFFFF!", thePlayer, 255, 0, 0, true) end end addCommandHandler("vr", voteRedo, false, false) addCommandHandler("voteredo", voteRedo, false, false) ------ Race_voting: -- -- racemidvote_server.lua -- -- Mid-race random map vote and -- NextMapVote handled in this file -- local lastVoteStarterName = '' local lastVoteStarterCount = 0 ---------------------------------------------------------------------------- -- displayHilariarseMessage -- -- Comedy gold ---------------------------------------------------------------------------- function displayHilariarseMessage( player ) if not player then lastVoteStarterName = '' else local playerName = getPlayerName(player) local msg = '' if playerName == lastVoteStarterName then lastVoteStarterCount = lastVoteStarterCount + 1 if lastVoteStarterCount == 5 then msg = playerName .. ' started a vote. Hardly a suprise.' elseif lastVoteStarterCount == 10 then msg = 'Guess what! '..playerName .. ' started ANOTHER vote!' elseif lastVoteStarterCount < 5 then msg = playerName .. ' started another vote.' else msg = playerName .. ' continues to abuse the vote system.' end else lastVoteStarterCount = 0 lastVoteStarterName = playerName msg = playerName .. ' started a vote.' end outputRace( msg ) end end ---------------------------------------------------------------------------- -- displayKillerPunchLine -- -- Sewing kits available in the foyer ---------------------------------------------------------------------------- function displayKillerPunchLine( player ) if lastVoteStarterName ~= '' then outputRace( 'Offical news: Everybody hates ' .. lastVoteStarterName ) end end ---------------------------------------------------------------------------- -- startMidMapVoteForRandomMap -- -- Start the vote menu if during a race and more than 30 seconds from the end -- No messages if this was not started by a player ---------------------------------------------------------------------------- function startMidMapVoteForRandomMap(player) -- Check state and race time left if not stateAllowsRandomMapVote() or g_CurrentRaceMode:getTimeRemaining() < 30000 then if player then outputRace( "I'm afraid I can't let you do that, " .. getPlayerName(player) .. ".", player ) end return end displayHilariarseMessage( player ) exports.votemanager:stopPoll() -- Actual vote started here local pollDidStart = exports.votemanager:startPoll { title='Do you want to change to a random map?', percentage=51, timeout=15, allowchange=true, visibleTo=getRootElement(), [1]={'Yes', 'midMapVoteResult', getRootElement(), true}, [2]={'No', 'midMapVoteResult', getRootElement(), false;default=true}, } -- Change state if vote did start if pollDidStart then gotoState('MidMapVote') end end addCommandHandler('new',startMidMapVoteForRandomMap) ---------------------------------------------------------------------------- -- event midMapVoteResult -- -- Called from the votemanager when the poll has completed ---------------------------------------------------------------------------- addEvent('midMapVoteResult') addEventHandler('midMapVoteResult', getRootElement(), function( votedYes ) -- Change state back if stateAllowsRandomMapVoteResult() then gotoState('Running') if votedYes then startRandomMap() else displayKillerPunchLine() end end end ) ---------------------------------------------------------------------------- -- startRandomMap -- -- Changes the current map to a random race map ---------------------------------------------------------------------------- function startRandomMap(ifByDeleteMap) -- Handle forced nextmap setting if maybeApplyForcedNextMap(ifByDeleteMap or false) then return end -- Get a random map chosen from the 10% of least recently player maps, with enough spawn points for all the players (if required) local map = getRandomMapCompatibleWithGamemode( getThisResource(), 10, g_GameOptions.ghostmode and 0 or getTotalPlayerCount() ) if map then g_IgnoreSpawnCountProblems = map -- Uber hack 4000 if not exports.mapmanager:changeGamemodeMap ( map, nil, true ) then problemChangingMap() elseif ifByDeleteMap then deleteThisMap(ifByDeleteMap) end else outputWarning( 'startRandomMap failed' ) end end ---------------------------------------------------------------------------- -- outputRace -- -- Race color is defined in the settings ---------------------------------------------------------------------------- function outputRace(message, toElement) toElement = toElement or g_Root local r, g, b = getColorFromString(string.upper(get("color"))) if getElementType(toElement) == 'console' then outputServerLog(message) else if toElement == rootElement then outputServerLog(message) end if getElementType(toElement) == 'player' then message = '[PM] ' .. message end outputChatBox(message, toElement, r, g, b) end end ---------------------------------------------------------------------------- -- problemChangingMap -- -- Sort it ---------------------------------------------------------------------------- function problemChangingMap() outputRace( 'Changing to random map in 5 seconds' ) local currentMap = exports.mapmanager:getRunningGamemodeMap() TimerManager.createTimerFor("resource","mapproblem"):setTimer( function() -- Check that something else hasn't already changed the map if currentMap == exports.mapmanager:getRunningGamemodeMap() then startRandomMap() end end, math.random(4500,5500), 1 ) end -- -- -- NextMapVote -- -- -- local g_Poll ---------------------------------------------------------------------------- -- startNextMapVote -- -- Start a votemap for the next map. Should only be called during the -- race state 'NextMapSelect' ---------------------------------------------------------------------------- function startNextMapVote() exports.votemanager:stopPoll() -- Handle forced nextmap setting if maybeApplyForcedNextMap() then return end -- Get all maps local compatibleMaps = exports.mapmanager:getMapsCompatibleWithGamemode(getThisResource()) -- limit it to eight random maps if #compatibleMaps > 8 then math.randomseed(getTickCount()) repeat table.remove(compatibleMaps, math.random(1, #compatibleMaps)) until #compatibleMaps == 8 elseif #compatibleMaps < 2 then return false, errorCode.onlyOneCompatibleMap end -- mix up the list order for i,map in ipairs(compatibleMaps) do local swapWith = math.random(1, #compatibleMaps) local temp = compatibleMaps[i] compatibleMaps[i] = compatibleMaps[swapWith] compatibleMaps[swapWith] = temp end local poll = { title="Choose the next map:", visibleTo=getRootElement(), percentage=51, timeout=15, allowchange=true; } for index, map in ipairs(compatibleMaps) do local mapName = getResourceInfo(map, "name") or getResourceName(map) table.insert(poll, {mapName, 'nextMapVoteResult', getRootElement(), map}) end local currentMap = exports.mapmanager:getRunningGamemodeMap() if currentMap then table.insert(poll, {"Play again", 'nextMapVoteResult', getRootElement(), currentMap}) end -- Allow addons to modify the poll g_Poll = poll triggerEvent('onPollStarting', g_Root, poll ) poll = g_Poll g_Poll = nil
  15. J'ai bidouiller un peu maintenant ca me met Soory, the map was restarted by vote alors que non j'ai rédemmarer le race etc... Dans le debugscript il n'y a propos de ca
  16. Merci, mais ca ne marche toujours pas quand je fais la commande /vr rien ne s'affiche.
  17. J'ai essayé de comprendre et j'ai modifié un peu le vr mais je ne suis pas sur que ca marche: --- VR --- local root = getRootElement() playersVoted = 0 mapRestarted = true cRedo = false getPlayersVR = getElementsByType ("player") for i,playersVR in ipairs(getPlayersVR) do setElementData( playersVR, "hasVoted", "nope" ) end rr,gg,bb = 255,0,0 function PlayerVoted(thePlayer) if mapRestarted then if (getElementData( thePlayer, "hasVoted" ) == "nope") then setElementData( thePlayer, "hasVoted", "voted" ) playersVoted = playersVoted + 1 if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then rr,gg,bb = 0,255,0 end outputChatBox("' ["..playersVoted.."/".. math.floor(getPlayerCount() /2 + 0.5) .."] ' #1a5eaa~> #c1c1c1Voted For Redo ( #FFFFFF"..getPlayerNametagText(thePlayer).." #C1C1C1)", root, rr, gg, bb, true) if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then cRedo = true triggerEvent("onVoteRedoSuccess", getRootElement()) outputChatBox ("#c1c1c1This Map Will Be Restarted By #1a5eaaVote", root, 255, 153, 0, true) end else outputChatBox("#c1c1c1You already #1a5eaaVoted #FFFFFFfor redo !", thePlayer, 255, 0, 0, true) end else outputChatBox("#440000Sorry#ffffff, #c1c1c1This map was restarted by #1a5eaaVote #FFFFFF!", thePlayer, 255, 0, 0, true) end end addCommandHandler ( "vr", PlayerVoted ) addCommandHandler ( "voteredo", PlayerVoted ) ------
  18. Merci, pour le modifications, toutefois je ne sais pas trop quoi modifier dans le script de voteredo du coup si tu peux m'éclairé. --- VR --- local root = getRootElement() playersVoted = 0 mapRestarted = true cRedo = false getPlayersVR = getElementsByType ("player") for i,playersVR in ipairs(getPlayersVR) do setElementData( playersVR, "hasVoted", "nope" ) end rr,gg,bb = 255,0,0 function PlayerVoted(thePlayer) if mapRestarted then if (getElementData( thePlayer, "hasVoted" ) == "nope") then setElementData( thePlayer, "hasVoted", "voted" ) playersVoted = playersVoted + 1 if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then rr,gg,bb = 0,255,0 end outputChatBox("' ["..playersVoted.."/".. math.floor(getPlayerCount() /2 + 0.5) .."] ' #1a5eaa~> #c1c1c1Voted For Redo ( #FFFFFF"..getPlayerNametagText(thePlayer).." #C1C1C1)", root, rr, gg, bb, true) if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then cRedo = true outputChatBox ("#c1c1c1This Map Will Be Restarted By #1a5eaaVote", root, 255, 153, 0, true) end else outputChatBox("#c1c1c1You already #1a5eaaVoted #FFFFFFfor redo !", thePlayer, 255, 0, 0, true) end else outputChatBox("#440000Sorry#ffffff, #c1c1c1This map was restarted by #1a5eaaVote #FFFFFF!", thePlayer, 255, 0, 0, true) end end addCommandHandler ( "vr", PlayerVoted ) addCommandHandler ( "voteredo", PlayerVoted ) ------ Merci
  19. Bonjour, j'ai un soucis avec mon userpanel, je voudrais limiter le nombre de maps dans la queue à 1 pour pouvoir ajouter un script de voteredo par les joueurs, je veux donc limite les maps par ne pas perdre de maps dans la queue en cas de voteredo. J'ai essayé de touché un peu au code mais sans succès. Je pense qu'il faut modifier du code a 2 endroits: _outputChatBox = outputChatBox local colorCode = "#0088FF" local colorTable = {0,136,255} local minPlayerCount = 0 shopPrice = { carColor = 10000, headlightColor = 15000, disco = 50000, police = 80000, gray = 150000, pink = 200000, map = 5000, } function onPanelStarted() makeScoreboardColumns() for _,thePlayer in pairs(getElementsByType("player")) do if isPlayerLogged(thePlayer) then refreshScoreboard(thePlayer) setElementData(thePlayer,"timeLogged",getTickCount()) end end updateSettings() end addEventHandler("onResourceStart",getRootElement(),onPanelStarted) function onPanelStop() for _,thePlayer in pairs(getElementsByType("player")) do if isPlayerLogged(thePlayer) then addValue(thePlayer,"timePlayed",(getTickCount()-getElementData(thePlayer,"timeLogged"))) setElementData(thePlayer,"timeLogged",getTickCount()) end end end addEventHandler("onResourceStop",getRootElement(),onPanelStop) function onPlayerLoginToServer() if isPlayerLogged(source) then setElementData(source,"timeLogged",getTickCount()) if not getElementData(source,"joinAdded") then addValue(source,"timesJoined",1) setElementData(source,"joinAdded",true) end onPlayerLoginHandler(source) sentMapQueueToClients() end end addEventHandler("onPlayerLogin",getRootElement(),onPlayerLoginToServer) function onPlayerLoginHandler(thePlayer) if isPlayerLogged(thePlayer) then checkPlayerDataOnLogin(thePlayer) refreshScoreboard(thePlayer) updateUserpanelData(thePlayer) premiumPlayerLogin(thePlayer) updatePlayerAchievements(thePlayer) checkAchievements(thePlayer,1) checkAchievements(thePlayer) callClientFunction(thePlayer,"allowBind",true) updatePlayerRank(thePlayer) setPlayerData(source,"nickName",getPlayerName(thePlayer)) end end function onPlayerLogoutFromServer(thePreviousAccount) setAccountData(thePreviousAccount,"timePlayed",tonumber(getAccountData(thePreviousAccount,"timePlayed"))+(getTickCount()-getElementData(source,"timeLogged"))) setElementData(source,"timeLogged",getTickCount()) callClientFunction(source,"allowBind",false) end addEventHandler("onPlayerLogout",getRootElement(),onPlayerLogoutFromServer) function onPlayerQuitFromServer() if isPlayerLogged(source) then declinePVPForPlayer(source) addValue(source,"timePlayed",getTickCount()-getElementData(source,"timeLogged")) setElementData(source,"timeLogged",getTickCount()) end end addEventHandler("onPlayerQuit",getRootElement(),onPlayerQuitFromServer) function makeScoreboardColumns() call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Cash",getRootElement(),70) call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Points",getRootElement(),70) call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Rank",getRootElement(),70) end function refreshScoreboard(thePlayer) if isPlayerLogged(thePlayer) then local playerCash = getPlayerData(thePlayer,"cash") local playerPoints = getPlayerData(thePlayer,"EXP") setElementData(thePlayer,"Cash","$"..playerCash) setElementData(thePlayer,"Points",playerPoints) else setElementData(thePlayer,"Cash","Guest") setElementData(thePlayer,"Points","Guest") setElementData(thePlayer,"Rank","?") end end function getServerMaps(thePlayer) --if isPlayerLogged(thePlayer) then local mapsTable = call(getResourceFromName("mapmanager"),"getMapsCompatibleWithGamemode",getResourceFromName("race")) local mapsToSent = {mapName = {},resourceName = {}} for id,map in pairs(mapsTable) do table.insert(mapsToSent.mapName,getResourceInfo(map, "name") or getResourceName(map)) table.insert(mapsToSent.resourceName,getResourceName(map)) end callClientFunction(thePlayer,"updateMapList",mapsToSent) --end end function updatePlayersGridlist() local playersTable = {} for i,thePlayer in pairs(getElementsByType("player")) do if isPlayerLogged(thePlayer) then table.insert(playersTable,getPlayerName(thePlayer)) end end callClientFunction(getRootElement(),"updatePlayerGridlist",playersTable) end addEventHandler("onPlayerJoin",getRootElement(),updatePlayersGridlist) addEventHandler("onPlayerLogin",getRootElement(),updatePlayersGridlist) addEventHandler("onPlayerLogout",getRootElement(),updatePlayersGridlist) addEventHandler("onPlayerQuit",getRootElement(),updatePlayersGridlist) function onPlayerChangeNickHandler(arg1,arg2) if arg2 and isPlayerLogged(source) then setPlayerData(source,"nickName",arg2) end setTimer(updatePlayersGridlist,1000,1) end addEventHandler("onPlayerChangeNick",getRootElement(),onPlayerChangeNickHandler) function getPlayerStats(searchPlayer,playerWanted) if searchPlayer and playerWanted then if isPlayerLogged(searchPlayer) then local playerStats = {} playerStats[1] = getPlayerData(searchPlayer,"cash") playerStats[2] = getPlayerData(searchPlayer,"EXP") playerStats[3] = getPlayerData(searchPlayer,"mapsPlayed") playerStats[4] = getPlayerData(searchPlayer,"mapsWon") if playerStats[3] ~= 0 then playerStats[5] = (math.floor(playerStats[4]/playerStats[3]*100)).."%" else playerStats[5] = "0%" end playerStats[6] = getPlayerData(searchPlayer,"totalHunters") playerStats[7] = getPlayerData(searchPlayer,"totalToptimes") playerStats[8] = getPlayerData(searchPlayer,"firstToptimes") playerStats[9] = getPlayerData(searchPlayer,"playedPVP") playerStats[10] = getPlayerData(searchPlayer,"wonPVP") if playerStats[9] ~= 0 then playerStats[11] = tonumber(math.floor(playerStats[10]/playerStats[9]*100)).."%" else playerStats[11] = "0%" end playerStats[12] = msToTimeString(getPlayerData(searchPlayer,"timePlayed")) playerStats[13] = getPlayerData(searchPlayer,"timesJoined") playerStats[14] = getPlayerData(searchPlayer,"totalSpins") playerStats[15] = getPlayerData(searchPlayer,"wonSpins") playerStats[16] = getPlayerData(searchPlayer,"totalBets") playerStats[17] = getPlayerData(searchPlayer,"betsWon") local achU = 0 for i=1,achievementCount do if getPlayerData(searchPlayer,"ach"..i) == 1 then achU = achU + 1 end end playerStats[18] = achU.."/"..achievementCount playerStats[19] = getPlayerData(searchPlayer,"maxWinstreak") playerStats[20] = getPlayerData(searchPlayer,"playedDM") playerStats[21] = getPlayerData(searchPlayer,"wonDM") playerStats[22] = getPlayerData(searchPlayer,"playedDD") playerStats[23] = getPlayerData(searchPlayer,"wonDD") callClientFunction(playerWanted,"setWantedStats",getPlayerName(searchPlayer),playerStats) end end end function onMapStartingHandler(mapInfo) mapType = false if string.find(mapInfo.name,"[DM]",1) then mapType = "DM" elseif string.find(mapInfo.name,"[DD]",1) then mapType = "DD" end for _,thePlayer in pairs(getElementsByType("player")) do if isPlayerLogged(thePlayer) then if getElementData(thePlayer,'currentPVP') then local pvpData = getElementData(thePlayer,'currentPVP') pvpData.started = true setElementData(thePlayer,'currentPVP',pvpData) end addValue(thePlayer,"mapsPlayed",1) if mapType then if mapType == "DM" then addValue(thePlayer,"playedDM",1) elseif mapType == "DD" then addValue(thePlayer,"playedDD",1) end end end end startBettingTime() end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),onMapStartingHandler) function checkPickupedPickup(pickupID,pickupType,pickupModel) if pickupType == "vehiclechange" then if pickupModel == 425 then if isPlayerLogged(source) then hunterReachedHandler(source) end end setPlayerVehicleColors(source) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkPickupedPickup) function hunterReachedHandler(thePlayer) if isPlayerLogged(thePlayer) then addValue(thePlayer,"totalHunters",1) addValue(thePlayer,"cash",500) addValue(thePlayer,"EXP",5) outputChatBox("#0088FF[HUNTER]#ffffff You reached hunter and earned {colorCode}5 #ffffff points and {colorCode}$500 #ffffff cash.",thePlayer,255,255,255,true) refreshScoreboard(thePlayer) checkAchievements(thePlayer,3)
  20. I dont really understand you have one exemple ?
  21. Hello, I have a problem with resolution on my server, i use resolution 1920 x 1080 and i have this result: http://www.casimages.com/i/14111905024020354.png http://www.casimages.com/i/141119050238131537.png But i have players who use 800 x 600 and have this result: http://www.casimages.com/i/141119050144969278.png http://www.casimages.com/i/141119050233578220.png On the 800 x 600 time left time passed too much big and can't see all the menu on the userpanel. How i can fix that ?
  22. Enfaite, le voteredo decale la map seulement quand il y en a que 1 dans le map queue autrement il remplace. Merci pour le code, je vais essayer pour voir, et je t'ai envoyé le lien du multigamemode en pm. Edit: la le voteredo ne fonctionne plus. Cordialement
  23. Salut, merci pour ta reponse rapide, Voila mon voteredo: --- VR --- local playersVoted = 0 local sistaredando = 0 function Votaredo(thePlayer) local currentMap = exports.mapmanager:getRunningGamemodeMap() local mapName = getMapName(currentMap) if getElementData( thePlayer, "havotato" ) == false then if not redo[mapName] then if sistaredando == 0 then playersVoted = playersVoted + 1 outputChatBox("[VR] "..getPlayerName(thePlayer).." #FFFFFFvoted for a redo. ["..playersVoted.."/".. math.floor(getPlayerCount() /2 + 0.5) .."]",getRootElement(),0,136,255, true) setElementData( thePlayer, "havotato", true) if playersVoted >= math.floor(getPlayerCount() /2 + 0.5) then redo[mapName] = setTimer(function(mapName) redo[mapName] = false end,900000,1,mapName) outputChatBox ("[VoteRedo] #FFFFFFThis map will be restarted by vote", thePlayer,0,136,255,true) sistaredando = 1 if #mapQueue ~= 0 then for i=#mapQueue,1 do mapQueue[i+1] = mapQueue[i] end mapQueue[1] = mapName triggerEvent("onUseranelWantSetMap",getRootElement(),mapQueue[1]) else mapQueue[1] = mapName triggerEvent("onUseranelWantSetMap",getRootElement(),mapQueue[1]) end callClientFunction(getRootElement(),"updateMapQueueList",mapQueue) end else showServerMsg(thePlayer,"Voteredo","This map will be redone.") end else showServerMsg(thePlayer,"Voteredo","This map has been already redone.") end else showServerMsg(thePlayer,"Voteredo","You already voted.") end end addCommandHandler ( "vr", Votaredo ) Et serais tu apte a me coder un map loader compatible avec mon multigamemode et pour quel somme environ.
  24. Salut, j'ai un soucis avec mon userpanel, dans mon userpanel je peux acheter plusieurs maps a la fois et ils s'ajoutent dans le map queue, malheureusement quand nous faisons un /vr pour restart la map, la map qui suis dans le map queue se supprime et laisse place a la map qui est redo. J'aimerais donc modifié cela pour pouvoir acheté seulement une map a la fois puis quand la map est passé pouvoir en racheté une autre. -- Buy a next map function buyMap(thePlayer,mapName,command) local account = getPlayerAccount(thePlayer) if not (isGuestAccount(account)) then local playerCash = tonumber(getAccountData(account,"cash")) if not (mapName == "") then if playerCash >= mapCost then if command then mapName = getMapName(mapName) else mapName = tostring(mapName) end if not mapTimer[mapName] then table.insert(mapQueue,mapName) local freeMaps = tonumber(getAccountData(account,"freeMaps")) if freeMaps ~= 0 then addStat(account,"freeMaps",-1) else setAccountData(account,"cash",playerCash - mapCost) end addStat(account,"buyedMaps",1) scoreboardRefresh(thePlayer) mapTimer[mapName] = true setTimer(resetMapTimer,1500000,1,mapName) if #mapQueue == 1 then triggerEvent("onUseranelWantSetMap",getRootElement(),mapQueue[1]) end callClientFunction(thePlayer,"setFreeMapPurchase",getAccountData(account,"freeMaps")) unlockAchievement(thePlayer,18) unlockAchievement(thePlayer) outputChatBox("#0099CCNext: #FFFFFF"..getPlayerNametagText(thePlayer).." #FFFFFFbought map "..tostring(mapName).."",getRootElement(),255,255,255,true) callClientFunction(getRootElement(),"updateMapQueueList",mapQueue) else showServerMsg(thePlayer,"Buy nextmap","#FFFFFFYou can't set this map now, wait some time to set!") end else showServerMsg(thePlayer,"Buy nextmap","#FFFFFFYou don't have enough money to set a map!") end else showServerMsg(thePlayer,"Buy nextmap","#FFFFFFPlease select a map from the list first!") end end end Et ma petite question a part, je possède un multigamemode, mais il me manque un fichier qui permet de load les maps, le scripteur ma dit qu'il s'agissait d'un map loader en php, si quelqu'un serait apte a m'aidé sur ce sujet. Et j'ai aussi une question par rapport au downlaod des maps sur un serveur, certains serveurs ou l'on a pas besoin de re dl la musique a chaque fois ce qui acclère le temps de téléchargement de tout les maps. Cordialement
×
×
  • Create New...