[Ajuda] No-Lag - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] No-Lag (
/showthread.php?tid=307919)
No-Lag -
Lukinhas_Ice - 01.01.2012
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
{
if(damagedid != INVALID_PLAYER_ID)
{
new Float:HEALTH;
new Float:ARMOR;
new Float:DAMAGE;
GetPlayerArmour(damagedid, ARMOR);
GetPlayerHealth(damagedid, HEALTH);
if(ARMOR > 0)
{
if(amount > ARMOR)
{
DAMAGE = amount - ARMOR;
HEALTH = HEALTH - DAMAGE;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, HEALTH);
return 1;
}
ARMOR = ARMOR - amount;
SetPlayerArmour(damagedid, ARMOR);
}
if(ARMOR < 1)
{
HEALTH = HEALTH - amount;
SetPlayerHealth(damagedid, HEALTH);
}
}
}
return 1;
}
se atira no lag continua perdendo hp, e se atira na skin perde tambйm, queria que sу se atira-se na skin o player perdeste HP
Re: [AJUDA] No-Lag -
Kmatsu - 01.01.2012
seta o team de todos os players para o mesmo e retire isso do script
pawn Код:
if(GetPlayerTeam(playerid) != GetPlayerTeam(damagedid))
@Edit:
vai ficar assim:
pawn Код:
//No OnPlayerConnect
SetPlayerTeam(playerid, 1); //ou entao qualquer outro numero, mas todos tem q ser o mesmo
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(damagedid != INVALID_PLAYER_ID)
{
new Float:HEALTH,
Float:ARMOR,
Float:DAMAGE;
GetPlayerArmour(damagedid, ARMOR);
GetPlayerHealth(damagedid, HEALTH);
if(ARMOR > 0)
{
if(amount > ARMOR)
{
DAMAGE = amount - ARMOR;
HEALTH = HEALTH - DAMAGE;
SetPlayerArmour(damagedid, 0.0);
SetPlayerHealth(damagedid, HEALTH);
return 1;
}
ARMOR = ARMOR - amount;
SetPlayerArmour(damagedid, ARMOR);
}
if(ARMOR < 1)
{
HEALTH = HEALTH - amount;
SetPlayerHealth(damagedid, HEALTH);
}
}
return 1;
}
Re: [AJUDA] No-Lag -
Lуs - 01.01.2012
Quote:
Originally Posted by Los
Dano sem Lag
- Sabe nas versхes anteriores do samp, vocк tinha que atirar na frente da pessoa para poder acerta-la (isso й o lag). Agora no 0.3d й possнvel sem precisar atirar na frente da pessoa:
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) { new Float:Life, Float:Colete, Float:Dano; GetPlayerArmour(damagedid, Colete); GetPlayerHealth(damagedid, Life); if(Colete > 0) { if(amount > Colete) { Dano = amount - Colete; Life = Life - Dano; SetPlayerArmour(damagedid, 0.0); SetPlayerHealth(damagedid, Life); return 1; } Colete = Colete - amount; SetPlayerArmour(damagedid, Colete); } if(Colete < 1) { Life = Life - amount; SetPlayerHealth(damagedid, Life); } return 1; }
|
Ou...
Quote:
Originally Posted by Stewie`
Acho que й isso.
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) {
if(GetPlayerTarget(playerid) != damagedid) return 0; //Nгo vai passar para outros scripts, pois й invбlido (Cheat/Unsync)
new Float:fSwap; GetPlayerArmour(damagedid, fSwap);
fSwap -= amount;
if(fSwap < 0.0) { SetPlayerArmour(playerid, 0.0);
new Float:fHealth; GetPlayerHealth(playerid, fHealth);
SetPlayerHealth(playerid, fSwap + fHealth); return 1; }
SetPlayerArmour(playerid, fSwap); return 1; }
|
Re: [AJUDA] No-Lag -
Lukinhas_Ice - 02.01.2012
os 2 que foram postados nos cуdigos uteis eu jб tinha testado, esse que o Kmatsu postou tambйm nгo funcionou =/
Re: [AJUDA] No-Lag -
ToySoldier - 17.02.2013
jб tinha postado isso em otro lugar, ve ae
https://sampforum.blast.hk/showthread.php?tid=415353