21.06.2012, 15:50
Hi , i made a bitting code , so i putted it in a command to test it on me
So the problem , is whene the bitten player lose his armour , & i use /bit again , it gives him a new armour with more 100 resistence instead of making the player loose Health... i don't know what's wrong... i really need your Help Thanks.
pawn Код:
dcmd_bit(playerid, params[])
{
new Float:Health, Float:a;
GetPlayerArmour(playerid,a);
if(a > 0)
{
SetPlayerArmour(playerid, a-10);
GameTextForPlayer(playerid,"A ~r~zombie ~w~ hits your ~g~armour ~w~!",2000,4);
}
else
{
if (IsInfected[playerid] == 0)
{
GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid, Health-5);
InfectionTime[playerid] = 0;
StopTimer[playerid] = SetTimer("infectiontimer", 1000, true);//starts infection
IsInfected[playerid] = 1;
GameTextForPlayer(playerid,"A ~r~zombie ~w~ hits you !",2000,4);
}
else
{
GetPlayerHealth(playerid,Health);
SetPlayerHealth(playerid, Health-5);
GameTextForPlayer(playerid,"A ~r~zombie ~w~ hits you !",2000,4);
}
}
return 1;
}