Jump to content

help in script


nasserdfdd

Recommended Posts

Posted
onPlayerWasted 
getPlayerTeam 
-- check the player's team who got killed and the killer. 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

He means, when the player dies, it will trigger the event onPlayerWasted then check if the player was in team criminal or not by using getPlayerTeam

Like :

 function getTheKiller (killer) 
         team = getPlayerTeam ( killer ) 
         if team == "Criminal" then 
          -- now we must cancel his stars 
         else 
          -- now here we must not cancel the stars        
     end 
end 
  
addEventHandler("onPlayerWasted",root,getTheKiller) 

Hope it helps : >

"When i'll grow older, i'll be stronger, they'll call me freedom, just like a waving flag"

"Have confidence in yourself, no problem is impossible in life"

Posted
function test ( source,killer )  
    local level = getPlayerWantedLevel ( killer ) 
       if getTeamName(getPlayerTeam(killer)) == "Criminal" then 
         if getTeamName(getPlayerTeam(source)) == "Criminal" then 
           setPlayerWantedLevel ( killer, level) 
        end 
    end 
end 
addEventHandler ( "onPlayerWasted", getRootElement (), test ) 

2vjs7it.jpg

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