RdX Posted May 12, 2014 Share Posted May 12, 2014 السلام عليكم ورحمة الله وبركاته انا عندي كود فيه ارقام لكن عشان اغير الارقام لزم اخش ملف .lua و اغيره و خش الاف تي بي و ارفع الملف المعدل انا لا ابيه اقدر اغير الارقام من settings حقت المودات يا ليت تفهموني function onPlayerDeadInRace() local thePlayer = source local dPlayers = getDeadRacePlayers() local aPlayers = getAliveRacePlayers() local Position = aPlayers + 1 if dPlayers + aPlayers >= 1 then local cashForPlayer = math.floor((2500/Position)*(dPlayers + aPlayers)) local pointsForPlayer = math.floor((500/Position)*(dPlayers + aPlayers)) givePlayerMoney(thePlayer,cashForPlayer) setElementData(thePlayer,"Points",tonumber(getElementData(thePlayer,"Points"))+pointsForPlayer) updatePlayerRank ( thePlayer ) if Position == 1 then outputChatBox ("#ff9900[system] #ffffff1st! You got #FFFFFF" .. pointsForPlayer .." #FFFFFFPoints #abcdefAnd Won #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) if LastWinners[1] == "" then if LastWinners[2] == "" then if LastWinners[3] == "" then if LastWinners[4] == "" then if LastWinners[5] == "" then LastWinners[5] = thePlayer else LastWinners[4] = thePlayer end else LastWinners[3] = thePlayer end else LastWinners[2] = thePlayer end else LastWinners[1] = thePlayer end else LastWinners[5] = LastWinners[4] LastWinners[4] = LastWinners[3] LastWinners[3] = LastWinners[2] LastWinners[2] = LastWinners[1] LastWinners[1] = thePlayer end else outputChatBox ("#ff9900[system] #ffffffYou got #FFFFFF" .. pointsForPlayer .." #FFFFFFpoints #abcdefand #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Deaths",tonumber(getElementData(thePlayer,"Deaths"))+1) end else outputChatBox("#ff9900[system] #ffffffMinimum 2 players to get stats and cash!",thePlayer,255,255,255,true) end end addEvent("onPlayerWasted", true) addEventHandler("onPlayerWasted", gRoot , onPlayerDeadInRace) Link to comment
RdX Posted May 12, 2014 Author Share Posted May 12, 2014 الارقام هاذي local cashForPlayer = math.floor((2500/Position)*(dPlayers + aPlayers)) local pointsForPlayer = math.floor((500/Position)*(dPlayers + aPlayers)) 2500,500 ابيكم تسأأعدوني عشان اقدر اغيرها من المود سيتنق Link to comment
jafar Posted May 12, 2014 Share Posted May 12, 2014 أول شيء ضيف ف الميتا : "*BindKey" value="F1" desc="" /> بعدين داخل المود : -- Server Side -- addEventHandler ( "onResourceStart", resourceRoot, function ( ) setElementData ( resourceRoot, "Key", get ( "BindKey" ) ); end ); addEventHandler( "onSettingChange", root, function ( setting, _, value ) if setting == "*resourceName.BindKey" then setElementData ( resourceRoot, "Key", value ); end end ); -- Client Side -- bindKey ( getElementData ( resourceRoot, "Key" ), "down", function ( ) guiSetVisible ( window, not guiGetVisible ( window ) ); showCursor ( guiGetVisible ( window ) ); end ); سوه بنفس الطريقة , وجيب الأرقام بالداتا Link to comment
RdX Posted May 12, 2014 Author Share Posted May 12, 2014 طيب ممكن تسوي لي بس حقت Cash و تشرحلي وش سويت ؟ bindKey ( getElementData ( resourceRoot, "Key" ), "down", function ( ) guiSetVisible ( window, not guiGetVisible ( window ) ); showCursor ( guiGetVisible ( window ) ); end ); + هاذي ما فهمتها Please سو لي وحده و اشرحها لي Link to comment
3NAD Posted May 12, 2014 Share Posted May 12, 2014 <settings> <setting name="*cash" value="2500" desc="Cash For Player" /> <setting name="*points" value="500" desc="Points For Player" /> </settings> function onPlayerDeadInRace() local thePlayer = source local dPlayers = getDeadRacePlayers() local aPlayers = getAliveRacePlayers() local Position = aPlayers + 1 if dPlayers + aPlayers >= 1 then local cashForPlayer = math.floor(((tonumber(cash) or 2500)/Position)*(dPlayers + aPlayers)) local pointsForPlayer = math.floor(((tonumber(points) or 500)/Position)*(dPlayers + aPlayers)) givePlayerMoney(thePlayer,cashForPlayer) setElementData(thePlayer,"Points",tonumber(getElementData(thePlayer,"Points"))+pointsForPlayer) updatePlayerRank ( thePlayer ) if Position == 1 then outputChatBox ("#ff9900[system] #ffffff1st! You got #FFFFFF" .. pointsForPlayer .." #FFFFFFPoints #abcdefAnd Won #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Wins",tonumber(getElementData(thePlayer,"Wins"))+1) if LastWinners[1] == "" then if LastWinners[2] == "" then if LastWinners[3] == "" then if LastWinners[4] == "" then if LastWinners[5] == "" then LastWinners[5] = thePlayer else LastWinners[4] = thePlayer end else LastWinners[3] = thePlayer end else LastWinners[2] = thePlayer end else LastWinners[1] = thePlayer end else LastWinners[5] = LastWinners[4] LastWinners[4] = LastWinners[3] LastWinners[3] = LastWinners[2] LastWinners[2] = LastWinners[1] LastWinners[1] = thePlayer end else outputChatBox ("#ff9900[system] #ffffffYou got #FFFFFF" .. pointsForPlayer .." #FFFFFFpoints #abcdefand #FFFFFF" .. cashForPlayer .."$",thePlayer,255,255,255,true) setElementData(thePlayer,"Deaths",tonumber(getElementData(thePlayer,"Deaths"))+1) end else outputChatBox("#ff9900[system] #ffffffMinimum 2 players to get stats and cash!",thePlayer,255,255,255,true) end end addEvent("onPlayerWasted", true) addEventHandler("onPlayerWasted", gRoot , onPlayerDeadInRace) addEventHandler( "onSettingChange", resourceRoot, function ( setting, _, value ) if setting == "*"..getResourceName(getThisResource())..".cash" then cash = get("cash") elseif setting == "*"..getResourceName(getThisResource())..".points" then points = get("points") end end ) Link to comment
#DRAGON!FIRE Posted May 13, 2014 Share Posted May 13, 2014 كل اكوادكـ خاطئة المفروض استخدام : fromJSON 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