FANDOM


Ovaj callback se poziva kada igrac nacini stetu drugom.


Ovaj callback je dodan u verziji 0.3d i nece raditi na ranijim!

Parametri:

(playerid, issuerid, Float:amount, weaponid, bodypart)
playerid ID igraca koji je nacinio stetu.
issuerid ID igraca nad kojim je nacinjena steta INVALID_PLAYER_ID ako je nacinio sam sebi.
amount Kolicina stete nacinjena igracu.
weaponid ID oruzija kojim je nacinjena steta
bodypart Deo tela koji je pogodjen. (NAPOMENA: Ovaj parametar je dodan u verziji 0.3z i nemojte ga koristiti na ranijim!)
Return
1 - Dopusta ovom callbacku da bude koristen drugde u skripti.
0 - Nedopusta ovom callbacku da bude koristen dalje u skripti

Primer Edit

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID) // Ako nije igrac nacinio sam sebi stetu
    {
        new
            infoString[128],
            weaponName[24],
            victimName[MAX_PLAYER_NAME],
            attackerName[MAX_PLAYER_NAME];
 
        GetPlayerName(playerid, victimName, sizeof (victimName));
        GetPlayerName(issuerid, attackerName, sizeof (attackerName));
 
        GetWeaponName(weaponid, weaponName, sizeof (weaponName));
 
        format(infoString, sizeof(infoString), "%s je nacinio %.0f stete igracu %s, oruzijem: %s", attackerName, amount, victimName, weaponName);
        SendClientMessageToAll(-1, infoString);
    }
    return 1;
}

Primer: Pogodak u glavu snajperom (0.3z) Edit

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
    {
        // Jedan pogodak u glavu snajperom postavlja helte na 0
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.