Jump to content

تصحيح كود


Recommended Posts

السلام عليكم شباب

انا عامل كود كده رتب لتيم مافيا

المشكله لما بكتب 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 )

 

Edited by L3yr
Link to comment
55 minutes ago, #BrosS said:

L3yr4 مافي وظيفة

كيف ماطلعلك غلط

 

Edited 1 hour ago by L3yr
 
يا انه معدل يا انه كان يبي يكتب L3yr4 
-------
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 )

 

  • Like 1
Link to comment
3 hours ago, #BrosS said:

L3yr4 مافي وظيفة

كيف ماطلعلك غلط

 

 

2 hours ago, coNolel said:
Edited 1 hour ago by L3yr
 
يا انه معدل يا انه كان يبي يكتب L3yr4 

-------
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 )

 

المشكله ما طلعلى اخطاء عشان اعرف اعدلو 

Link to comment
48 minutes ago, #BrosS said:

قلت الخطأ بنفسك

وش المطلوب منا

تعديله انا مش عارف فين الخطاء اخى بروس المشكله ما انحلت لما مسحت سطر L3yr 4

Edited by L3yr
Link to comment

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...