FS sniper -
SeckSeck - 02.01.2016
Alguem tem o FS de 2 tiros de sniper mata o player?
Tipo esse:
http://forum.sa-mp.com/archive/index.php/t-133364.html
porem o link acima o download ta dando erro,
Re: FS sniper -
CaioTJF - 02.01.2016
Nгo й sу por pra Sniper arrancar metade da vida do player no tiro?
Re: FS sniper -
Jefferson Santos - 02.01.2016
http://forum.sa-mp.com/showthread.ph...highlight=OPSP
Re: FS sniper -
arakuta - 02.01.2016
Nossa, precisa mesmo de um FS pra isto?
Ignore o post do Jefferson Santos, desde a 0.3d jб й ultrapassado.
Existem N formas de se fazer isto, a mais simples й sу retirar 59 da vida do jogador, ou do colete, ou de ambos criando um algoritmo simples.
PHP код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new Float:pHP, Float:pAP;
GetPlayerHealth(playerid,pHP);
GetPlayerArmour(playerid,pAP);
if(pAP > 59)
pAP -= 59;
else
{
pHP -= (59 - pAP);
pAP = 0;
}
SetPlayerHealth(playerid,pHP);
SetPlayerArmour(playerid,pAP);
return 1;
}
Nгo esquece de verificar se a arma й uma sniper... E se quiser distвncia vocк pode calcular de N maneiras tambйm... A mais fбcil й pelo tamanho do vetor de tiro.
Re: FS sniper -
Coringa_Vilao - 02.01.2016
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart){
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9){
SetPlayerHealth(playerid, 0.0);
}
return 1;
}
esse acima й headshot , caso queria em outros lugares sу adicionar
"bodypart == nє" , para mais sobre:
https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
https://sampwiki.blast.hk/wiki/Body_Parts
Re: FS sniper -
BykiLler - 02.01.2016
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart){
new Float:Pvida, Float:Pcolete;
if(issuerid != INVALID_PLAYER_ID && weaponid == 34){
GetPlayerHealth(playerid, Pvida);
GetPlayerArmour(playerid, Pcolete);
if(Pvida >= 1 && Pcolete == 0){
SetPlayerHealth(playerid, Pvida-50);
}else if(Pvida >= 1 && Pcolete >= 1 && Pcolete <= 79){
SetPlayerArmour(playerid, Pcolete-50);
}else if(Pvida >= 1 && Pcolete >= 1 && Pcolete >= 80){
SetPlayerArmour(playerid, Pcolete-20);
}
}
return 1;
}