27.10.2010, 06:37
I was trying to making a infection so heres what got and my problem is that when u press key_fire u lose hp
how could i make it so if u punch the player u punch they lose hp
Example: A noob punchs a mafia the mafia loses hp
how could i make it so if u punch the player u punch they lose hp
Example: A noob punchs a mafia the mafia loses hp
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_FIRE)) {
if(GetPlayerWeapon(playerid) == 4) {
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health - 50.0);
return 1;
}
}
return 1;
}