[PEDIDO] Anti-TeamKill
#1

Pessoal , se alguem puder ajudar , queria pedir um Anti-TeamKill que nгo tirasse vida do outro player , porque o meu sistema de gangs , quando o player spawna , se nгo aparecer a mensagem aquela "Vai jogar com a gang: [Tal]" seria como se nгo tivesse gang e poderia matar todo mundo , Alguem pode fazer um sistema aн ?

Se puderem ajudar , Agradeзo , Dou + Rep.
Reply
#2

Up, tambйm preciso '-'
Reply
#3

cara se vc usar assim, quem for do mesmo teamid nao vai perder vida
AddPlayerClassEx(teamid, skin, Float: x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
Reply
#4

https://sampwiki.blast.hk/wiki/SetPlayerTeam
Reply
#5

й sу subistituir AddPlayerClass por AddPlayerClassEx(teamid...

Exemplo:

pawn Code:
AddPlayerClass(TEAM_HUMANS, 100, 0.0,0.0,0.0, 0.0, 0,0,0,0,0);

// No OnPlayerRequestClass
SetPlayerTeam(playerid, TEAM_HUMANS);
Todos os que sejam do time "Humanos" estarгo com anti-team kill.
Reply
#6

Ainda nao entendi, como ficaria esse? (Gang Grove)

pawn Code:
AddPlayerClass(28,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClass(29,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClass(65,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
RequestClass

pawn Code:
}
    else if(classid == 3 || classid == 4 || classid == 5 ) {
    GameTextForPlayer(playerid,"~B~GROVE STREET",6000,6);
    SetPlayerColor(playerid,0x00D900AA);
    gangteam[playerid] = 1;
    format(pgang[playerid],15,pgangnames[1]);
    }
Reply
#7

pawn Code:
AddPlayerClass(GANG_GROOVE,28,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClass(GANG_GROOVE,29,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClass(GANG_GROOVE,65,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //

pawn Code:
else if(classid == 3 || classid == 4 || classid == 5 ) {
    GameTextForPlayer(playerid,"~B~GROVE STREET",6000,6);
    SetPlayerColor(playerid,0x00D900AA);
    gangteam[playerid] = 1;
    format(pgang[playerid],15,pgangnames[1]);
    SetPlayerTeam(playerid,  GANG_GROOVE);
    }
Reply
#8

@eDIT; Consegui, mais a cada linha que eu coloco isso da esse warning

pawn Code:
tag mismatch
Reply
#9

GANG_GROOVE й a definiзгo do id de sua Gang/Time:

Exemplo:
pawn Code:
#define GANG_GROOVE 12456575456467674546754657654
Reply
#10

Olha meu edit, tentei desse outro jeito tambem e deu esse WARNING

pawn Code:
tag mismatch
a cada linha aumenta um warning
Reply
#11

ae, eu esqueci de colocar "Ex"

pawn Code:
AddPlayerClassEx(GANG_GROOVE,28,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClassEx(GANG_GROOVE,29,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
    AddPlayerClassEx(GANG_GROOVE,65,2364.9746,-649.1373,127.7856,279.9052,0,0,0,0,0,0); //
Reply
#12

Aee deu certo, +rep e obrigado pela ajuda !
Reply
#13

pawn Code:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(Team[playerid] == Team[damagedid])//Adapte.
    {
        new Float:L_VIDA; GetPlayerHealth(damagedid, L_VIDA);
        SetPlayerHealth(damagedid, L_VIDA+amount);
        SendClientMessage(playerid, -1, "Nгo ataque um colega seu!");
    }
    return 1;
}
Abraзos.
Reply
#14

Quote:
Originally Posted by Los
View Post
pawn Code:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(Team[playerid] == Team[damagedid])//Adapte.
    {
        new Float:L_VIDA; GetPlayerHealth(damagedid, L_VIDA);
        SetPlayerHealth(damagedid, L_VIDA+amount);
        SendClientMessage(playerid, -1, "Nгo ataque um colega seu!");
    }
    return 1;
}
Abraзos.
Й mais aplausнvel utilizar funзхes nativas prуprias para isto,
alguns players reclamariam de "Cheater/Hacker" porque perde
vida e ganha dinovo, famoso "Recovery".

Entгo aconselho usar funзхes prуprias para isto,
como AddPlayerClassEx e SetPlayerTeam.

Abs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)