decreasing player health? look! :D
#1

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?
Reply
#2

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
Reply
#3

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
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)