Does not function - 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)
+--- Thread: Does not function (
/showthread.php?tid=550315)
Does not function -
Shazwan - 12.12.2014
Hello, im making my own fitness system and 1 shot bullet but it does not do any of it.
heres the code
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
Fitness(playerid);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 0 && bodypart == 3)
{
Bullet(playerid);
}
return 1;
}
This should be the respond
Код:
Delay:Bullet[100, i](playerid)
{
if(!PlayerInfo[playerid][pHitbul])
{
SetPlayerHealth(playerid, 0.0);
PlayerInfo[playerid][pBullet] -= 1;
}
return 1;
}
Delay:Fitness[10, i](playerid)
{
if(PlayerInfo[playerid][pFitness] >= 1500)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-30);
}
if(PlayerInfo[playerid][pFitness] >= 1000)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-25);
}
if(PlayerInfo[playerid][pFitness] >= 700)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-20);
}
if(PlayerInfo[playerid][pFitness] >= 500)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-15);
}
if(PlayerInfo[playerid][pFitness] >= 300)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-10);
}
if(PlayerInfo[playerid][pFitness] >= 100)
{
new Float:HP;
GetPlayerHealth(playerid,HP);
SetPlayerHealth(playerid,HP-5);
}
return 1;
}
any ideas what is wrong or wrong scripting?
Re: Does not function -
Shazwan - 12.12.2014
It does like this, each fitness level is the level of -HP damage to the player id. Its like unlocking a new level to get more damage.
Re: Does not function -
Shazwan - 12.12.2014
Oh sorry i think you didn't catch that, fitness system works like this, they need to exercise and the fitness will be increase to the level that has been set, each level contain more damage. the more the fitness they get, the stronger they can kill you.
Re: Does not function -
Shazwan - 12.12.2014
um where can i edit it?