18.12.2014, 04:06
(
Последний раз редактировалось Shazwan; 18.12.2014 в 05:07.
)
Greetings, SA-MP members i really need your help kinda confusing using this both callbacks and sometimes its not working.
I want to script a sniper bullet that is countable bullet that can be finish and 1 shot 1 kill. each shot will -1 bullet
this is the 2 example callbacks im using it but failed.
i really appreciate your help if can thanks. rep+
I want to script a sniper bullet that is countable bullet that can be finish and 1 shot 1 kill. each shot will -1 bullet
Код:
PlayerInfo[playerid][pBullet] -= 1;
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
PlayerInfo[playerid][pBullet] -= 1;
}
return 1;
}
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(PlayerInfo[playerid][pBullet] >= 1)
{
new Float:HP;
if(weaponid == 34)
GetPlayerHealth(damagedid,HP);
SetPlayerHealth(damagedid,HP-100);
PlayerInfo[playerid][pBullet] -= 1;
}
return 1;
}

