Cops n Robbers Anti team kill
#10

Although it would be better to just use SetPlayerTeam, give this a try.

PHP код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)  
{  
   if ( 
Shooter != INVALID_PLAYER_ID && GetPlayerTeam(Shooter) != Civilians)   
    {   
        if ( 
GetPlayerTeamTarget ) == GetPlayerTeamShooter ) ) // check if the victim is from the same team as the shooter.   
        
{   
   
            new 
Float:hp;  
            
GetPlayerHealth(Targethp);  
            
SetPlayerHealth(Targethp HealthLost);  
            
SetPlayerHealthShooter);  
            
SendClientMessageShooterCOLOR_RED"Team killing is not allowed!" );   
            
GivePlayerMoneyShooter, - 5000 );   
        }  
    }  
    return 
1;  

Now, if the shooter is not a civillian the script will execute, but if the shooter is a civillian the target will take daamge.
Reply


Messages In This Thread
Cops n Robbers Anti team kill - by kyriakos587 - 15.05.2015, 10:48
Re: Cops n Robbers Anti team kill - by arlindi - 15.05.2015, 10:51
Re: Cops n Robbers Anti team kill - by Vince - 15.05.2015, 10:52
Re: Cops n Robbers Anti team kill - by kyriakos587 - 15.05.2015, 10:54
Re: Cops n Robbers Anti team kill - by Konstantinos - 15.05.2015, 10:59
Re: Cops n Robbers Anti team kill - by rappy93 - 15.05.2015, 10:59
Re: Cops n Robbers Anti team kill - by kyriakos587 - 15.05.2015, 11:00
Re: Cops n Robbers Anti team kill - by arlindi - 15.05.2015, 11:02
Re: Cops n Robbers Anti team kill - by kyriakos587 - 15.05.2015, 11:03
Re: Cops n Robbers Anti team kill - by rappy93 - 15.05.2015, 11:05

Forum Jump:


Users browsing this thread: 1 Guest(s)