Jump to content

VOTE REDO


justboy

Recommended Posts

Posted (edited)

السلام عليكم ورحة الله وبركاته

local Count = getPlayerCount ( )/ 2 
local mapName = getMapName() 
local CountCommand = 0 
local i = CountCommand + 0+0 
  
  
addEvent("onMapStarting", true) 
addEventHandler("onMapStarting", root, function ( ) 
     for _,v in ipairs(getElementsByType("player")) do 
                setElementData ( v, "voteRedo", false ) 
  
     end 
end) 
  
  
addCommandHandler("vr", 
    function(source) 
        if i == math.ceil(Count) then return end 
        if getElementData ( source, "voteRedo" ) == true then return end 
             
            setElementData (source, "voteRedo", true) 
            i = i+1 
            outputChatBox("#629632[VoteRedo]#FFFFFF["..i.."/"..math.ceil(Count).."]",root,225,225,225,true) 
                if i == math.ceil(Count) then 
                    outputChatBox("#629632[VoteRedo]#FFFFFFMap Will Be restarted",root ,5,5,5,true) 
                                    i = i - math.ceil(Count) 
                                    exports.mapmanager:changeGamemodeMap(mapName)                   
                end 
    end)     
  

DeBug:- 'mapmanger_exports.lua:64: mapmanger : lnvalid map specified'

& المود مايحط الماب وهذ الخطأ أللي يطلع بـ الدي بق ^

Edited by Guest
Posted

بأسم الماب string يعطي نص getMapName بينما فنكشن resource يتطلب المنت changeGamemodeMap فنكشن

getRunningGamemodeMap استخدم عشان تجيب اسم الماب الحالي

Posted (edited)
بأسم الماب string يعطي نص getMapName بينما فنكشن resource يتطلب المنت changeGamemodeMap فنكشن

getRunningGamemodeMap استخدم عشان تجيب اسم الماب الحالي

مشكور اشتغل

edit:

يعيال المشكلة يعيد الماب علطول

انا ابيه اول مايخلص الماب

او اللاعبين كلهم يموتوا

ممكن الفكشنات

او الطريقة

Edited by Guest
Posted
انت ضايف المود لجروب الادمن ؟

Group : Admin (Acl admin )

يب اكيد

انت مو فاهمني بالظبط

انا ابي فنكشن لما الماب يخلص او ...او.. ـ

يسوي اعادة للماب

Posted

ذولي :

local Count = getPlayerCount ( )/ 2 
local mapName = getMapName() 
local CountCommand = 0 
local i = CountCommand + 0+0 

لازم يتحدثون كل ماب

edit :

عشان انه يعيد الماب على طول

انت مخلي لو وصل الفوت للي تبيه ع طول يعيد الماب خل اكواد اعادة الماب معى ايفنت

مثلاً onRaceStateChanging or onPlayerRaceWasted

  • 3 weeks later...
Posted
local Count = getPlayerCount ( )/ 2 
local mapName = exports.mapmanager:getRunningGamemodeMap() 
local CountCommand = 0 
local i = CountCommand + 0+0 
  
  
addEventHandler("onResourceStart",resourceRoot, 
        function() 
                setElementData (root, "JB", true ) 
        end) 
  
        
addEvent("onRaceStateChanging", true) 
addEventHandler("onRaceStateChanging", getRootElement(), 
        function(newState, oldState) 
                                if(newState == "Running")then 
                                                                        for _,v in ipairs(getElementsByType("player")) do 
                                        setElementData ( v, "voteRedo", false ) 
  
  
                                end 
        end 
                end) 
  
addEvent("onRaceStateChanging", true) 
addEventHandler("onRaceStateChanging",root, 
        function(newState, oldState) 
                                for _,v in ipairs(getElementsByType("player")) do 
                                
                                
                if newState == "LoadingMap" then 
                                setElementData(v ,"mapLo",false) 
                                        elseif newState == "Running" then 
                                                setElementData(v ,"mapLo",true) 
  
        
        end 
        end 
        end) 
  
addCommandHandler("vr", 
    function(source) 
                if getElementData ( source, "mapLo" ) == false then return outputChatBox("#629632[VoteRedo]#FFFFFFWait for start map",source,225,225,225,true) end 
        if i == math.ceil(Count) then return outputChatBox("#629632[VoteRedo]#FFFFFFMap Will Be restarted",source,225,225,225,true) end 
        if getElementData ( source, "voteRedo" ) == true then return outputChatBox("#629632[VoteRedo]#FFFFFFYou Already Vote",source,225,225,225,true) end 
                                if getElementData ( source, "JB" ) == false then return outputChatBox("#629632[VoteRedo]#FFFFFFU can't",source,225,225,225,true) end 
  
            setElementData (source, "voteRedo", true) 
            i = i+1 
            outputChatBox("#629632[VoteRedo]#FFFFFF"..getPlayerName(source).."#FFFFFF Has Voted For redo #629632["..i.."/"..math.ceil(Count).."]",root,225,225,225,true) 
                if i == math.ceil(Count) then 
                    outputChatBox("#629632[VoteRedo]#FFFFFFMap Will Be restarted",root ,5,5,5,true) 
                                        
                                                                        
                                end 
    end)   
        
addEvent("onRaceStateChanging", true) 
addEventHandler("onRaceStateChanging", root, 
        function(newState, oldState) 
                if i == math.ceil(Count) then                                                                   
                        if(newState == "PostFinish")then 
                          exports.mapmanager:changeGamemodeMap(mapName) 
                                if (exports.mapmanager:changeGamemodeMap(mapName)) then 
                                        setElementData (root, "JB", false ) 
                                        outputChatBox("#629632[VoteRedo]#FFFFFFMap Has Been Restarted",root ,5,5,5,true) 
                                        i = i - i 
                                        end 
                                end 
                        end 
                end) 
                
                
                
addEvent("onRaceStateChanging", true) 
addEventHandler("onRaceStateChanging", root, 
        function(newState, oldState) 
                if(newState == "PostFinish")then 
                        if getElementData (root, "JB" ) == false then 
                                if (newState == "Running" ) then 
                                        removeElementData(root,"JB")            
                                end 
                        end 
                end 
        end) 

هو الماب مايتكرر مرتين

JB ابي اذا بدا ماب جديد على الالمنت داتا

false or true او ينحذف يصير

الاخطاء في التحققات

ادري مافهمتوا شيء جربوا المود عشان تفهموا ان شاء الله تجربوه في ماب بدون ريسباون عشا ن يشتغل

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...