Jump to content

لا استطيع قتل فريق تيمي


Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

   hospitalsTable = { 
        { 1179.22803,-1323.52087,14.15908}, 
        { 1606.85559,1822.30957,10.82031}, 
        { -2659.85767,632.98505,14.45313}, 
        } 
          
        function spawn() 
          local i=0 
          local minDistance=100000 
          local minHospital = 0 
          local posX, posY, posZ = getElementPosition(source) 
          for key,val in ipairs(hospitalsTable) do 
            i=i+1 
            local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) 
            if (distance) then 
              minDistance=distance 
              minHospital=i 
            end 
          end 
          spawnPlayer ( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) 
        end 
        addEventHandler("onPlayerWasted", getRootElement(),spawn) 
  
addEventHandler("onPlayerLogin", root, 
function(_, account) 
    if not getAccountData(account, "FirstTime") then 
        outputChatBox("You're playing for the first time!", source, 0, 255, 0) 
        setAccountData(account, "FirstTime", true) 
    else 
        outputChatBox("This is not the first time for you!", source, 255, 0, 0) 
    end 
end) 
  
addEventHandler( "onPlayerQuit", root, function(  ) 
    local PlayerAcc = getPlayerAccount ( source ) 
    if ( PlayerAcc and not isGuestAccount ( PlayerAcc ) and getPlayerTeam ( source ) ) then 
    setAccountData ( PlayerAcc, "PlayerTeam", getTeamName ( getPlayerTeam ( source ) )) 
    setAccountData ( PlayerAcc, "skin", getElementModel ( source  ) ) 
        end 
end ) 
  
addEventHandler( "onPlayerLogin", root, function ( _,acc ) 
     local SavedTeam_ = getAccountData( acc, "PlayerTeam" ) 
     local skinPlayer = getAccountData( acc, "skin" ) 
     if ( SavedTeam_ ) then 
         setPlayerTeam ( source, getTeamFromName ( SavedTeam_ ) ) 
         outputChatBox ( "* You Joined Team: "..SavedTeam_, source, 0, 255, 0, true ) 
         if (  skinPlayer ) then 
        setElementModel ( source ,  skinPlayer ) 
     else 
       setElementModel ( source , 0 ) 
           end 
          else 
           setPlayerTeam ( source, getTeamFromName ( "NoTeam" ) ) 
    end 
end ) 
  
addEventHandler ("onPlayerSpawn",root, function (  ) 
local Acc = getPlayerAccount( source ) 
 if ( Acc and not isGuestAccount ( Acc ) ) then 
setTimer(setElementModel,500,1,source,getAccountData( Acc, "skin" )) 
            end 
     end 
   ) 
    
    
 addEventHandler("onElementModelChange", root, function (   ) 
 if ( getElementType(source) == "player" ) then 
local Acc = getPlayerAccount ( source ) 
if ( Acc and not isGuestAccount ( Acc )) then 
 setAccountData ( Acc, "skin", getElementModel ( source  ) ) 
                 end 
            end 
   end 
 )        
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...