Quote:
Originally Posted by suhrab_mujeeb
You cannot control the time interval between which the player sends data to the server. The fastest of them can be OnPlayerUpdate but still needs the player to send the update to the server. Try using a better script. The script you created is pointless. It checks the gTeam on every "if". Try this simpler code (Your code modified):
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) { if ( Shooter != INVALID_PLAYER_ID ) { if ( gTeam[Target] == gTeam[Shooter] ) // check if the victim is from the same team as the shooter. {
new Float:hp; new Float:ap; GetPlayerHealth(Target, hp); SetPlayerHealth(Target, hp + HealthLost); GetPlayerArmour(Target, ap); SetPlayerArmour(Target, ap + ArmourLost); SendClientMessage( Shooter, COLOR_RED, "Team killing is not allowed!" ); } } return 1; }
|
LOL Brother. Try re-reading my script.. You will get to know why i just dont want one if over there.
Because in my TEAM_DEFINES Two teams r allies , So they cannot shooot them as well! Nor the player can shoot them