17.07.2013, 18:37
when none goverment player in the area it will work fine and losing his health , BUT
the problem is if None Goverment guy in the area and and his health keep losing then if a goverment guy
came in the same area it will stop losing health of that non goverment player
this is ongamemodeinit
SetTimer("PlayerZoneChecker",6000,true);
the problem is if None Goverment guy in the area and and his health keep losing then if a goverment guy
came in the same area it will stop losing health of that non goverment player
this is ongamemodeinit
SetTimer("PlayerZoneChecker",6000,true);
Код:
forward PlayerZoneChecker(); public PlayerZoneChecker() { new Float:X,Float:Y,Float:Z; new Float:pheal; foreach (new i : Player){ GetPlayerPos(i,X,Y,Z); GetPlayerHealth(i,pheal); if ( IsSpawned[i]==1 && !IsPlayerNPC(i) ){ if (IsPlayerInArea(i,-1701.5393,647.1263,-1571.7961,718.8061)||IsPlayerInArea(i,-1336.4915,705.7386,-1182.2593,823.7599)|| IsPlayerInArea(i,-1780.9791,939.1539,-1683.4225,1063.1093)||IsPlayerInArea(i,-1546.4114,260.0058,-1222.0865,521.8784)){ if (gTeam[i] == TEAM_COP || gTeam[i] == TEAM_ARMY || gTeam[i] == TEAM_CIA || gTeam[i] == TEAM_MEDIC) return 1; SetPlayerHealth(i,pheal -15); GameTextForPlayer(i, "your losing health", 2000, 3); } } } return 1; }