SA-MP Forums Archive
decreasing player health? look! :D - 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: decreasing player health? look! :D (/showthread.php?tid=176161)



decreasing player health? look! :D - thomas.. - 12.09.2010

well

i have this
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            for(new i = 0; i < MAX_VEHICLES; i++)
            {
                if(IsAttached[i] == true)
                {
                    if(GetPlayerVehicleID(playerid) == i)
                    {
                        new i2 = GetPlayerVehicleID(playerid);
                        (VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2] * Dist),7,100);
                        new Float:armour, Float:newarmour;
                        GetPlayerArmour(i,armour);
                        if(armour > 0){
                        newarmour = armour - -5;
                        SetPlayerArmour(i,newarmour);
                        }
                        else {
                        new Float:health,Float:newhealth;
                        GetPlayerHealth(i,health);
                        newhealth = health - -5;
                        SetPlayerHealth(i,newhealth);
                        }
                    }
                }
            }
        }
    }
    return 1;
}
and i know about this not being right

pawn Код:
(VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2] * Dist),7,100);
i try to use isplayerinrangeofpoint but i get errors/warnings


but when i have it like this the other players health doesnt go down?


Re: decreasing player health? look! :D - LarzI - 12.09.2010

Tell us what you are trying to do, then I might be able to help



This forum requires that you wait 120 seconds between posts. Please try again in 40 seconds. stfu


Re: decreasing player health? look! :D - thomas.. - 12.09.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Tell us what you are trying to do, then I might be able to help



This forum requires that you wait 120 seconds between posts. Please try again in 40 seconds. stfu
so that if a player is near the gun, and player hits the right key, it will shoot invisible bullets (< lol) but then it will decrease players health/armour


Re: decreasing player health? look! :D - LarzI - 12.09.2010

Hmm, I don't know how that could really work, so I can't help you, I'm sorry.