Search the Community
Showing results for tags 'ranks'.
-
السلام عليكم شباب انا عامل كود كده رتب لتيم مافيا المشكله لما بكتب setRank فى F8 مش بيجبلى انا فى انهى رتبه ايه الخطاء شباب function L3yr1 ( _, killer ) local playeraccount = getPlayerAccount ( killer ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then setAccountData ( playeraccount, "scoreData", ( getAccountData ( playeraccount, "scoreData" )+1 ) or 1 ) outputChatBox ( "score +1", killer, 255,255,255 ) end end ------ addEventHandler ( "onPlayerWasted", root, L3yr1 ) ------ function L3yr2 ( _, acc ) if ( acc ) and not isGuestAccount ( acc ) then setAccountData ( acc, "scoreData", ( getAccountData ( acc, "scoreData" ) ) or 1 ) myrank = getAccountData ( acc, "scoreData" ) or 1 outputChatBox ( myrank, source, 255,255,255 ) end end ------ addEventHandler ( "onPlayerLogin", root, L3yr2 ) ------ function L3yr3 ( player ) local playeraccount = getPlayerAccount ( player ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local team = getPlayerTeam ( source ) if team then local teamname = getTeamName ( team ) if teamname == "MAFIA" then local score = getAccountData ( playeraccount, "scoreData" ) or 1 local accountName = getAccountName ( playeraccount ) if score >= 50 then aclGroupAddObject (aclGetGroup("rank1"), "user."..accountName) outputChatBox ( "Now you get rank1", player, 255,255,255 ) elseif score >= 150 then outputChatBox ( "Now you get rank2", player, 255,255,255 ) aclGroupAddObject (aclGetGroup("rank2"), "user."..accountName) elseif score >= 350 then outputChatBox ( "Now you get rank3", player, 255,255,255 ) aclGroupAddObject (aclGetGroup("rank3"), "user."..accountName) elseif score >= 500 then outputChatBox ( "Now you get rank4", player, 255,255,255 ) aclGroupAddObject (aclGetGroup("rank4"), "user."..accountName) elseif score >= 1000 then outputChatBox ( "Now you get rank5", player, 255,255,255 ) aclGroupAddObject (aclGetGroup("rank5"), "user."..accountName) end end end end end ------- addCommandHandler ( "setRank", L3yr3 ) ------- function L3yr2 ( ) local acc = getPlayerAccount ( source ) if ( acc ) and not isGuestAccount ( acc ) then setAccountData ( acc, "scoreData", ( getAccountData ( acc, "scoreData" ) ) or 1 ) end end addEventHandler ( "onPlayerQuit", root, L3yr4 )