public OnPlayerUpdate(playerid)
{
if(Time[playerid] == POLICIA) // ISTO AQUI Й SO UM EXEMPLO ... SE O JOGADOR FOR DO TIME POLICIA ACONTECERA A FUNCAO ABAIXO
{
SetPlayerHealth(playerid, 100); //SETA A VIDA DO JOGADOR PARA 100
return 1;
}
return 1;
}
for(new x; x != MAX_PLAYERS; x++)
{
if(IsPlayerConnected(x)) continue;
SetPlayerTeam(x,2);
}
new Team[ MAX_PLAYERS ];
public public OnPlayerShootPlayer( Shooter, Target, Float:HealthLost, Float:ArmourLost )
{
new J1[ MAX_PLAYER_NAME ];
new J2[ MAX_PLAYER_NAME ];
GetPlayerName( Shooter, J1, 24 );
GetPlayerName( Target, J2, 24 );
for( new playerid = 0; player <= MAX_PLAYERS; playerid ++)
{
if( Team[ playerid ][ Shooter ] == Team[ playerid ][ Target ] )
{
SetPlayerHealth( Target, 100 );
}
}
return true;
}
new Team[ MAX_PLAYERS ];
public public OnPlayerShootPlayer( Shooter, Target, Float:HealthLost, Float:ArmourLost )
{
new J1[ MAX_PLAYER_NAME ];
new J2[ MAX_PLAYER_NAME ];
GetPlayerName( Shooter, J1, 24 );
GetPlayerName( Target, J2, 24 );
if( Team[ Shooter ] == Team[ Target ] )// Este codigo so ira setar a vida de quem levou um tiro caso ele seja do mesmo "time" do atirador. Caso nгo, ele perdera vida normalmente.
{
SetPlayerHealth( Target, 100 );
}
return true;
}
PHP код:
|
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
new Float:Hel;
GetPlayerHealth(Target,Hel);
if(Team[Shooter] == Team[Target])
{
SetPlayerHealth(Target,(Hel+HealthLost)); // Dб apenas a vida q foi tirada..
}
return 1;
} // Por que estavam a usar GetPlayerName??? \\