[Ajuda] Ant TK
#1

bom ja tentei com SetPlayerTeam nao foi tentei com AddPlayerClassEx tambem nao foi ambos da mesma gangue consegue se mata alguem poderia me dar um help rsrs


obrigado.
Reply
#2

pawn Код:
// Fim do GM

public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
{
    if(GetPlayerTeam(playerid) == GetPlayerTeamDamagedid(playerid) // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
pawn Код:
// Fim do GM

public OnPlayerGiveDamage(playerid,damagedid,Float:amount,weaponid)
{
    if(GetPlayerTeam(playerid) == GetPlayerTeamDamagedid(playerid) // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}
minha OnPlayerGiveDamage:

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Coleete, Float:Dano;
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    GetPlayerArmour(damagedid, Coleete);
    GetPlayerHealth(damagedid, Life);
    if(Coleete > 0)
    {
        if(amount > Coleete)
        {
            Dano = amount - Coleete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Coleete = Coleete - amount;
        SetPlayerArmour(damagedid, Coleete);
    }
    if(Coleete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    /*if(IsPlayerAimingTargetBodyPart(playerid, damagedid, 1))
    {
        PlayAudioStreamForPlayer(playerid, "http://introserver.ueuo.com/HeadShot.mp3");
        GameTextForPlayer(damagedid, "~r~HEAD ~w~SHOT", 2000, 0);
        GameTextForPlayer(playerid, "~r~HEAD ~w~SHOT", 2000, 0);
        SetPlayerHealth(damagedid, -1);
    }*/

    new s[20];
    format(s, 20, "+Dano %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    //PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    if(GetPlayerTeam(playerid) == MinhaGang[playerid] // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}

deu esse erro:

pawn Код:
C:\Users\Caio Alaf\Desktop\samp\gamemodes\GM-GG.pwn(854) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Coleete, Float:Dano;
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    GetPlayerArmour(damagedid, Coleete);
    GetPlayerHealth(damagedid, Life);
    if(Coleete > 0)
    {
        if(amount > Coleete)
        {
            Dano = amount - Coleete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Coleete = Coleete - amount;
        SetPlayerArmour(damagedid, Coleete);
    }
    if(Coleete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    /*if(IsPlayerAimingTargetBodyPart(playerid, damagedid, 1))
    {
        PlayAudioStreamForPlayer(playerid, "http://introserver.ueuo.com/HeadShot.mp3");
        GameTextForPlayer(damagedid, "~r~HEAD ~w~SHOT", 2000, 0);
        GameTextForPlayer(playerid, "~r~HEAD ~w~SHOT", 2000, 0);
        SetPlayerHealth(damagedid, -1);
    }*/

    new s[20];
    format(s, 20, "+Dano %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    //PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    if(GetPlayerTeam(playerid) == MinhaGang[playerid]) // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}
Reply
#5

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Coleete, Float:Dano;
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    GetPlayerArmour(damagedid, Coleete);
    GetPlayerHealth(damagedid, Life);
    if(Coleete > 0)
    {
        if(amount > Coleete)
        {
            Dano = amount - Coleete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Coleete = Coleete - amount;
        SetPlayerArmour(damagedid, Coleete);
    }
    if(Coleete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    /*if(IsPlayerAimingTargetBodyPart(playerid, damagedid, 1))
    {
        PlayAudioStreamForPlayer(playerid, "http://introserver.ueuo.com/HeadShot.mp3");
        GameTextForPlayer(damagedid, "~r~HEAD ~w~SHOT", 2000, 0);
        GameTextForPlayer(playerid, "~r~HEAD ~w~SHOT", 2000, 0);
        SetPlayerHealth(damagedid, -1);
    }*/

    new s[20];
    format(s, 20, "+Dano %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    //PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    if(GetPlayerTeam(playerid) == MinhaGang[playerid]) // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}
@Edit: Nao vi que o valdermorth postou.
Reply
#6

tipo o erro saiu mais ainda quem й da mesma gang da pra se mata
Reply
#7

Quote:
Originally Posted by BielCOP
Посмотреть сообщение
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    new Float:Life, Float:Coleete, Float:Dano;
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    GetPlayerArmour(damagedid, Coleete);
    GetPlayerHealth(damagedid, Life);
    if(Coleete > 0)
    {
        if(amount > Coleete)
        {
            Dano = amount - Coleete;
            Life = Life - Dano;
            SetPlayerArmour(damagedid, 0.0);
            SetPlayerHealth(damagedid, Life);
            return 1;
        }
        Coleete = Coleete - amount;
        SetPlayerArmour(damagedid, Coleete);
    }
    if(Coleete < 1)
    {
        Life = Life - amount;
        SetPlayerHealth(damagedid, Life);
    }
    /*if(IsPlayerAimingTargetBodyPart(playerid, damagedid, 1))
    {
        PlayAudioStreamForPlayer(playerid, "http://introserver.ueuo.com/HeadShot.mp3");
        GameTextForPlayer(damagedid, "~r~HEAD ~w~SHOT", 2000, 0);
        GameTextForPlayer(playerid, "~r~HEAD ~w~SHOT", 2000, 0);
        SetPlayerHealth(damagedid, -1);
    }*/

    new s[20];
    format(s, 20, "+Dano %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    //PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    if(GetPlayerTeam(playerid) == MinhaGang[playerid]) // Troque pela variбvel que define as equipes.
    {
        return 0;
    }
    return 1;
}
nгo seria OnPlayerTakeDamage?
Reply
#8

Tenta isso

Topo
PHP код:
forward TeamProtection(); 
OnGameModeInit
PHP код:
SetTimer("TeamProtection"5000 ,true); 
Fim do GM
PHP код:
public TeamProtection()
{
    for(new 
iMAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerTeam(igTeam[i]);// Troque o gTeam pela variбvel que define as gangs/equipes.
        
}
    }

Reply
#9

Quote:
Originally Posted by Cleitonboy23
Посмотреть сообщение
Tenta isso

Topo
PHP код:
forward TeamProtection(); 
OnGameModeInit
PHP код:
SetTimer("TeamProtection"5000 ,true); 
Fim do GM
PHP код:
public TeamProtection()
{
    for(new 
iMAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerTeam(igTeam[i]);// Troque o gTeam pela variбvel que define as gangs/equipes.
        
}
    }

certeza que й necessбrio uma loop para isso ?
Reply
#10

acho que n teria necessidade de criar um timer nгo acha?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)