Anti-DM Help (CNR)
#1

Hello, I want some help for my new gamemode.
I'm creating 'Cops and Robbers'. The help which I need is that If there is a COP (TEAM_COP) and there is a CIVILLIAN(TEAM_CIVI), If the cops shoot the civillian they do no damage to him and If the civillian shoots the cop he also doesn't do any damage BUT if the civillian gets wanted He and the cop can damage each other.

I would be very thankful If I get some help, I did search but couldn't find anything and I did find some threads but couldn't understand it. I'm a newbie so would like someone to help me please.
Thankyou!!
Reply
#2

PHP код:
        if(Player[issuerid][playerClass] == CLASS_CIVILIAN || Player[issuerid][playerClass] == CLASS_FIREFIGHTER || Player[issuerid][playerClass] == CLASS_MEDIC)
        {
            if(
Player[playerid][playerClass] == CLASS_ARMY || Player[playerid][playerClass] == CLASS_POLICE || Player[playerid][playerClass] == CLASS_CIA || Player[playerid][playerClass] == CLASS_FBI || Player[playerid][playerClass] == CLASS_SECRETSERVICE)
            {
                if(
Player[issuerid][playerWantedLevel] == 0)
                {
                    if(
Player[playerid][playerJailTime] <= 0)
                    {
                        
givePlayerWanted(issuerid6);
                        
sendWantedMessage(issuerid6);
                        
newPlayerColour(issuerid);
                    }
                }
            }
        }
        else if(
Player[issuerid][playerClass] == CLASS_POLICE || Player[issuerid][playerClass] == CLASS_ARMY || Player[issuerid][playerClass] == CLASS_CIA  || Player[issuerid][playerClass] == CLASS_FBI || Player[issuerid][playerClass] == CLASS_SECRETSERVICE)
        {
            if(
Player[playerid][playerClass] == CLASS_CIVILIAN || Player[playerid][playerClass] == CLASS_FIREFIGHTER || Player[playerid][playerClass] == CLASS_MEDIC)
            {
                if (
Player[playerid][playerWantedLevel] == 0)
                {
                    new 
Float:theirHealth;
                    
GetPlayerHealth(playeridtheirHealth);
                    
SetPlayerHealth(playeridtheirHealth 0);
                }
            }
        } 
Just an example,you should take a look at this

https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage|
or https://sampforum.blast.hk/showthread.php?tid=462189
Reply
#3

Hi there, thank you so much. OnPlayerTakeDamage was what I needed. Thank you for your help!
I'll try it when I'm on my laptop.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)