OnPlayerTakeDamage (bug) player morrendo com um golpe -
DaviCOP - 09.03.2014
Auguem pode me dizer por que os player estao morrendo ao levar apenas um soco o que eu fiz de errado ai ajudem por favor
Por acaso esta setando o life dos players para negativo? e se estiver como й o jeito certo?
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 0)
{
SetPlayerHealth(playerid, -3);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 1)
{
SetPlayerHealth(playerid, -7);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 2)
{
SetPlayerHealth(playerid, -19);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 3)
{
SetPlayerHealth(playerid, -19);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 4)
{
SetPlayerHealth(playerid, -19);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 5)
{
SetPlayerHealth(playerid, -31);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 6)
{
SetPlayerHealth(playerid, -31);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 7)
{
SetPlayerHealth(playerid, -31);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 8)
{
SetPlayerHealth(playerid, -21);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 9)
{
SetPlayerHealth(playerid, -13);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 10)
{
SetPlayerHealth(playerid, -20);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 11)
{
SetPlayerHealth(playerid, -7);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 12)
{
SetPlayerHealth(playerid, -21);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 13)
{
SetPlayerHealth(playerid, -31);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 14)
{
SetPlayerHealth(playerid, -21);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 15)
{
SetPlayerHealth(playerid, -31);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 16)
{
SetPlayerHealth(playerid, -20);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 18)
{
SetPlayerHealth(playerid, -50);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 22)
{
SetPlayerHealth(playerid, -15);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 23)
{
SetPlayerHealth(playerid, -7);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24)
{
SetPlayerHealth(playerid, -30);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 25)
{
SetPlayerHealth(playerid, -90);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 26)
{
SetPlayerHealth(playerid, -26);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 27)
{
SetPlayerHealth(playerid, -40);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 28)
{
SetPlayerHealth(playerid, -25);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 29)
{
SetPlayerHealth(playerid, -35);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 30)
{
SetPlayerHealth(playerid, -47);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 31)
{
SetPlayerHealth(playerid, -57);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 32)
{
SetPlayerHealth(playerid, -25);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 33)
{
SetPlayerHealth(playerid, -50);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 34)
{
SetPlayerHealth(playerid, 0);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 35)
{
SetPlayerHealth(playerid, -150);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 36)
{
SetPlayerHealth(playerid, -60);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 37)
{
SetPlayerHealth(playerid, -25);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 38)
{
SetPlayerHealth(playerid, -0);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 39)
{
SetPlayerHealth(playerid, -99);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 42)
{
SetPlayerHealth(playerid, -25);
return 1;
}
if(issuerid != INVALID_PLAYER_ID && (PlayerDados[playerid][Yonbi] < 1))
{
SetPlayerHealth(playerid, -25);
return 1;
}
return 1;
}
Re: OnPlayerTakeDamage player morre com um golpe -
ViictorDaay- - 09.03.2014
Exemplo:
PHP Code:
SetPlayerHealth(playerid, -99); // A vida do player vai ficar -99, nгo vai tirar 99 de 100 o certo seria,
SetPlayerHealth(playerid, 1); // Pronto vocк seto a vida do player para 1 й praticamente a mesma coisa de cima.
Re: OnPlayerTakeDamage player morre com um golpe -
DaviCOP - 09.03.2014
eu quero mudar o dano das armas voce encino a setar o life do player quando ele leva dano daquela arma nao й isso que eu to procurando
Re: OnPlayerTakeDamage player morre com um golpe -
VeNuZ_ - 09.03.2014
Tu estбs a por a vida do player negativa como queres que ele nao morra?
Para fazeres isso direito tens de pegar a vida do player para uma variбvel e tirar a vida que queres e depois sim fazes o SetPlayHealth.
Algo do gйnero:
pawn Code:
new Float:VidaTotal;
GetPlayerHealth(playerid, VidaTotal);
new VidaSemDamage = VidaTotal - 7.0;
SetPlayerHealth(playerid, VidaSemDamage);
Nao tenho a certeza se estarб correto pois nao touque no pawn а mais de um ano.
Re: OnPlayerTakeDamage player morre com um golpe -
DaviCOP - 09.03.2014
vou testar
Re: OnPlayerTakeDamage player morre com um golpe -
VeNuZ_ - 09.03.2014
Atualizei o cуdigo reveja
Re: OnPlayerTakeDamage player morre com um golpe -
DaviCOP - 09.03.2014
isso so vai funfar pra vida normal nao pro colete ne?
Re: OnPlayerTakeDamage player morre com um golpe -
VeNuZ_ - 09.03.2014
Podes verificar se ele tem colete, caso tenha retiras o valor ao colete e adicionas o colete com o damge tirado caso nao tenha, retiras o valor а vida e adicionas a vida sem o damage.
Caso queiras altearar o valor de damage das armas isso й possнvel pois se nao me engano jб usei, procura por: alterar damge das armas no search do fуrum.