(HELP) kills problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (HELP) kills problem (
/showthread.php?tid=216057)
(HELP) kills problem -
Amine_Mejrhirrou - 24.01.2011
hi all . i have a problem this is the code
Код:
if((newkeys & KEY_FIRE) && (team[playerid] == 6))
{
new Float:hp, Float:a;
new target = GetClosestPlayer(playerid);
if(GetDistanceBetweenPlayers(playerid,target) <= 1)
{
GetPlayerArmour(target,a);
if(a > 0)
{
SetPlayerArmour(target, a-20);
GetPlayerHealth(playerid,hp);
SetPlayerHealth(playerid, hp+5);
}
else
{
GetPlayerHealth(target,hp);
SetPlayerHealth(target, hp-7);
GetPlayerHealth(playerid,hp);
if(hp < 200) SetPlayerHealth(playerid, hp+10);
GetPlayerHealth(target,hp);
}
}
the problems is some times (if the the
playerid doesn't touche the
targerid withe hits ) the
targetid die but it's not because of the
playerid ! it's just caus the
tagetid losse all he's HP caus of the distance
can some one help
Re : (HELP) kills problem -
Amine_Mejrhirrou - 24.01.2011
oo i forgot
if the
playerid hit (touche ) the
targetid & then kill him thanks to distance ! the
playerid score 1
is that possible to make some thing like
GetPlayerHealth(
target,hp);
Код:
if(hp(target hp) = 0)
{
new score = GetPlayerScore(playйrid);
SetPlayerScore(playйrid, score+ 1);
}
or some thing like that
Re : (HELP) kills problem -
Amine_Mejrhirrou - 25.01.2011
com on pls some one help