08.11.2018, 18:02
O melhor jeito й vocк usar SetPlayerTeam em todos os players e em OnPlayerGiveDamage vocк configura o dano.
Os outros mйtodos eu ja tentei todos e pode atй funcionar mas fica bugado.
O problema de fazer isso й que buga na hora do player morrer, entгo vocк tem que configurar um jeito do player morrer quando a vida acabar, nгo fiz isso aqui mas se quiser eu faзo e posto.
Exemplo:
Os outros mйtodos eu ja tentei todos e pode atй funcionar mas fica bugado.
O problema de fazer isso й que buga na hora do player morrer, entгo vocк tem que configurar um jeito do player morrer quando a vida acabar, nгo fiz isso aqui mas se quiser eu faзo e posto.
Exemplo:
PHP код:
#include <a_samp>
new PlayerTeam[MAX_PLAYERS];
public OnPlayerSpawn(playerid){
SetPlayerTeam(playerid, 0);
PlayerTeam[playerid] = 0;
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
// Caso tente matar mesma gang
if(PlayerTeam[playerid] == PlayerTeam[damagedid]){
return 0;
}
new Float:life;
GetPlayerHealth(damagedid, life);
switch(weaponid)
{
case 35:
{
SetPlayerHealth(damagedid, life-0.5);
}
}
return 1;
}
// Usar isso no lugar de SetPlayerTeam
stock SetPlayerServerTeam(playerid, teamid){
return PlayerTeam[playerid] = teamid;
}
// Usar isso no lugar de GetPlayerTeam
stock GetPlayerServerTeam(playerid){
return PlayerTeam[playerid];
}