OnPlayerWeaponshot problem.
#1

pawn Код:
if(hittype == BULLET_HIT_TYPE_OBJECT) {
        if(IsValidObject(hitid)) {
            if(ObjectDamage[hitid] == true) {
   if(Team[playerid]!=A&&ObjectDamage[Object_ID[3]])
            {

                ObjectHP[hitid] -= random(10) + 1;
               
                if(ObjectHP[hitid] >= 0) {
                    new str[128];
                    format(str, sizeof(str), "~G~OBJECT DAMAGED!~N~~Y~OBJECT ID ~W~: ~R~ %d~N~~Y~HP LEFT ~W~: ~R~ %d", hitid, ObjectHP[hitid]);
                   
                    GameTextForPlayer(playerid, str, 1800, 3);
                   
                }
                if(ObjectHP[hitid] <= 0) {
                    DestroyObject(hitid);
                    CreateExplosion(1327.86621, -889.94873, 43.97300,10,10);
                }
            }

        }
    }
    }
The code should work like if team is in A they can't hit the object other team can.
Reply


Messages In This Thread
OnPlayerWeaponshot problem. - by Gaurav_Rawat - 03.01.2015, 14:11
AW: OnPlayerWeaponshot problem. - by CutX - 03.01.2015, 14:14
Re: OnPlayerWeaponshot problem. - by Gaurav_Rawat - 03.01.2015, 14:34

Forum Jump:


Users browsing this thread: 2 Guest(s)