OnlyPlayerTakedamage
#1

i have made the functions in the script as

Код:
 new: current = -1; but still gives me error's
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
        PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
		new Float:hp;
        GetPlayerHealth(playerid,hp);
        new Float:damage = (amount > hp) ? hp : amount;
        if (Player[issuerid][pTeam] == T_REF && Current != -1 && Player[playerid][pPlaying])
        {
                SetPlayerHealth(issuerid, 0);
        }
        if(Current != -1)
        {
                if((Player[issuerid][pPlaying] && Player[playerid][pPlaying]) && (!Player[issuerid][pDm] && !Player[playerid][pDm]) && (Player[issuerid][pTeam] != Player[playerid][pTeam]) && (Player[issuerid][pTeam] != T_REF && Player[playerid][pTeam] != T_REF))
                {
                        gRoundDamage[issuerid] += floatround(damage);
                    gRoundDamage2[issuerid] += floatround(damage);
                PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
                }
        }
        else
        {
                PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
        }
        if(Current != -1)
        {
                if((Player[issuerid][pTeam] != Player[playerid][pTeam]) && (Player[issuerid][pTeam] != T_REF && Player[playerid][pTeam] != T_REF))
                {
                        currentHpLoss[0][issuerid][playerid] +=  damage;
                        currentHpLoss[1][playerid][issuerid] +=  damage;
                        new buffer[128];
                        format(buffer, 128, "~g~Hit: %s~w~ (~g~Weapon: %s~w~)~g~ -~w~ (Damage: ~g~%i~w~)", PNames[playerid], WeaponNames[weaponid], floatround(currentHpLoss[0][issuerid][playerid]));
                        TextDrawSetString(txd[dodmg][issuerid], buffer);
           			  	format(buffer, 128, "~r~Hit by: %s~w~ (~r~Weapon: %s~w~)~r~ -~w~ (Damage: ~r~%i~w~)", PNames[issuerid], WeaponNames[weaponid], floatround(currentHpLoss[1][playerid][issuerid]));
                        TextDrawSetString(txd[takedm][playerid], buffer);
                        txdAlpha[0][issuerid] = 0xFF;
                        txdAlpha[1][playerid] = 0xFF;
                }
        }
        else
        {
                currentHpLoss[0][issuerid][playerid] +=  damage;
                currentHpLoss[1][playerid][issuerid] +=  damage;
                new buffer[128];
                format(buffer, 128, "~g~Hit: %s~w~ (~r~Weapon: %s~w~)~g~ -~w~ (Damage: ~g~%i~w~)", PNames[playerid], WeaponNames[weaponid], floatround(currentHpLoss[0][issuerid][playerid]));
             //   format(buffer, 128, "%s~n~-%i (%s)", PNames[playerid], floatround(currentHpLoss[0][issuerid][playerid]), WeaponNames[weaponid]);
                TextDrawSetString(txd[0][issuerid], buffer);
  			  	format(buffer, 128, "~r~Hit by: %s~w~ (~r~Weapon: %s~w~)~r~ -~w~ (Damage: ~r~%i~w~)", PNames[issuerid], WeaponNames[weaponid], floatround(currentHpLoss[1][playerid][issuerid]));
             //   format(buffer, 128, "%s~n~-%i (%s)", PNames[issuerid], floatround(currentHpLoss[1][playerid][issuerid]), WeaponNames[weaponid]);
                TextDrawSetString(txd[1][playerid], buffer);
                txdAlpha[0][issuerid] = 0xFF;
                txdAlpha[1][playerid] = 0xFF;
        }
        return 1;
}
Код:
D:\script\gamemodes\DeathMatchADD.pwn(340) : error 017: undefined symbol "Current"
D:\script\gamemodes\DeathMatchADD.pwn(344) : error 017: undefined symbol "Current"
D:\script\gamemodes\DeathMatchADD.pwn(348) : error 017: undefined symbol "gRoundDamage"
D:\script\gamemodes\DeathMatchADD.pwn(348) : warning 215: expression has no effect
D:\script\gamemodes\DeathMatchADD.pwn(348) : error 001: expected token: ";", but found "]"
D:\script\gamemodes\DeathMatchADD.pwn(348) : error 029: invalid expression, assumed zero
D:\script\gamemodes\DeathMatchADD.pwn(348) : fatal error 107: too many error messages on one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)