12.09.2010, 09:46
well
i have this
and i know about this not being right
i try to use isplayerinrangeofpoint but i get errors/warnings
but when i have it like this the other players health doesnt go down?
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;
}
pawn Код:
(VehCameraPos[i2][0]+(VehVectorPos[i2][0] * Dist),VehCameraPos[i2][1]+(VehVectorPos[i2][1] * Dist),VehCameraPos[i2][2]+(VehVectorPos[i2][2] * Dist),7,100);
but when i have it like this the other players health doesnt go down?