AYUDA, POR QUE NO SIRVE D:?
#1

Bueno tengo el siguiente cуdigo:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && UserPowers[issuerid][STARS] == 1 && GetPlayerTeam(issuerid) != GetPlayerTeam(playerid))
    {
        new Float:uHP,Float:uAR;
        if(uAR >= 1)
        {
            GetPlayerArmour(playerid, uAR);
            SetPlayerArmour(playerid, uAR - 15.0);
        }
        else if(uHP >= 1)
        {
            GetPlayerHealth(playerid, uHP);
            SetPlayerHealth(playerid, uHP - 15.0);
        }

    }
    return 1;
}
quй se supone tiene que daсar mas al jugador pero no funciona D: D:!! їQuй puedo hacer?
Reply
#2

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && UserPowers[issuerid][STARS] == 1 && GetPlayerTeam(issuerid) != GetPlayerTeam(playerid))
    {
        new Float:Vida[2], Float:NuevaVida[2];
        GetPlayerArmour(playerid, Vida[0]);
        GetPlayerHealth(playerid, Vida[1]);
        if(Vida[0] >= 1)
        {
            NuevaVida[0] = 15.0;
            amount = NuevaVida[0];
            SetPlayerArmour(playerid, - amount);
        }
        else if(Vida[1] >= 1)
        {
            NuevaVida[1] = 15.0;
            amount = NuevaVida[1];
            SetPlayerHealth(playerid, - amount);
        }

    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by OTACON
Посмотреть сообщение
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && UserPowers[issuerid][STARS] == 1 && GetPlayerTeam(issuerid) != GetPlayerTeam(playerid))
    {
        new Float:Vida[2], Float:NuevaVida[2];
        GetPlayerArmour(playerid, Vida[0]);
        GetPlayerHealth(playerid, Vida[1]);
        if(Vida[0] >= 1)
        {
            NuevaVida[0] = 15.0;
            amount = NuevaVida[0];
            SetPlayerArmour(playerid, - amount);
        }
        else if(Vida[1] >= 1)
        {
            NuevaVida[1] = 15.0;
            amount = NuevaVida[1];
            SetPlayerHealth(playerid, - amount);
        }

    }
    return 1;
}
gracias voy a probar y te avisoXD
edit: no sirve, lo mato de disparo y eso que le puse a 8.0 la nueva vida D:
EDIT 2:
use esto:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID && UserPowers[issuerid][TEST] == 1 && GetPlayerTeam(issuerid) != GetPlayerTeam(playerid))
    {
        new Float:Vida[2], Float:NuevaVida[2];
        GetPlayerArmour(playerid, Vida[0]);
        GetPlayerHealth(playerid, Vida[1]);
        if(Vida[0] >= 1)
        {
            NuevaVida[0] = 5.0;
            amount = NuevaVida[0];
            SetPlayerArmour(playerid,Vida[0] - amount);
        }
        else if(Vida[1] >= 1)
        {
            NuevaVida[1] = 5.0;
            amount = NuevaVida[1];
            SetPlayerHealth(playerid,Vida[1] - amount);
        }
    }
    return 1;
}
le baja la vida, y luego se le sube WTF! parece hack ayuda xD
osea le disparo y le baja un buen de vida / chaleco pero luego se le sube O_O como si se auto seteara al damage normal D:

Lo hize con OnPlayerShootPlayer y funciona bien pero no me gusta, no se puede usar con ontakedamage? D:
Reply
#4

intenta asi y fijate los printf y la wiki https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage_Es.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) {
    if(playerid != INVALID_PLAYER_ID) {
        new Float:Vida[2], Float:NuevaVida[2];
        GetPlayerArmour(playerid, Vida[0]);
        GetPlayerHealth(playerid, Vida[1]);
        if(Vida[0] >= 1) {
            NuevaVida[0] = 50.0;
            amount = NuevaVida[0];
            SetPlayerArmour(playerid, - amount);
            printf("ID:%d Perdio %f de Vida.",playerid,amount);
        }
        else if(Vida[1] >= 1) {
            NuevaVida[1] = 50.0;
            amount = NuevaVida[1];
            SetPlayerHealth(playerid, - amount);
            printf("ID:%d Perdio %f de Chaleco.",playerid,amount);
        }
    }
    return true;
}
Reply
#5

Quote:
Originally Posted by OTACON
Посмотреть сообщение
intenta asi y fijate los printf y la wiki https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage_Es.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) {
    if(playerid != INVALID_PLAYER_ID) {
        new Float:Vida[2], Float:NuevaVida[2];
        GetPlayerArmour(playerid, Vida[0]);
        GetPlayerHealth(playerid, Vida[1]);
        if(Vida[0] >= 1) {
            NuevaVida[0] = 50.0;
            amount = NuevaVida[0];
            SetPlayerArmour(playerid, - amount);
            printf("ID:%d Perdio %f de Vida.",playerid,amount);
        }
        else if(Vida[1] >= 1) {
            NuevaVida[1] = 50.0;
            amount = NuevaVida[1];
            SetPlayerHealth(playerid, - amount);
            printf("ID:%d Perdio %f de Chaleco.",playerid,amount);
        }
    }
    return true;
}
no sirve
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)