Need help
#1

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

Код:
PlayerInfo[playerid][pBullet] -= 1;
this is the 2 example callbacks im using it but failed.

Код:
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;
}
i really appreciate your help if can thanks. rep+
Reply
#2

can u explain a bit further about that bullet thinggy so that we can help you
Reply
#3

This thing

Код:
PlayerInfo[playerid][pBullet]
if they buy the bullet from the store they will receive 5 bullet, each bullet they shoot a player it will set the HP of the player to 0.

And each shot they shoot will -1 bullet

Код:
PlayerInfo[playerid][pBullet] -= 1;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)