Portal SAMP
[Ajuda] Erro estranho - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Erro estranho (/showthread.php?tid=2728)



Erro estranho - fear - 28/08/2022

boa tarde.. estou com esse erro estranho aqui


codigo:

Código PHP:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart)
{
    if(
PlayerInfo[playerid][preso] == true)return SetPlayerHealth(playerid,100);
    if(
PlayerInfo[playerid][Presoestadual] == true)return SetPlayerHealth(playerid,100);

    if(!
IsPlayerPaused(damagedid)) //verifica se o jogador que levou dano nao esta de esc
    
{
        if(
weaponid == 24 || weaponid == 34 || weaponid == 31 || weaponid == 30)
        {
            if(
bodypart == 9)
            {
                if(
hasHS[damagedid] == 0)
                {
                
PlayerInfo[playerid][hs]=1;
                foreach(new 
fr Player)
                if(
PlayerInfo[fr][modo] == 2)
                {
                    new 
string[150];
                    
format(string,sizeof(string),"~w~O(A)_Jogador(a)_~r~%s[%d]_~w~matou_o(a)_~y~%s[%d]_~w~com_um_~g~HS"Nome(playerid), Nome(damagedid), playerid);
                    
TextDrawSetString(InfoDeath,string);
                    
TextDrawShowForPlayer(fr,InfoDeath);
                    
SetPlayerHealth(damagedid0.0);
                    
SetPlayerArmour(damagedid0);
                    
hasHS[damagedid] = true;
                    }
                }
            }
        }
    }
    if(
IsPlayerPaused(damagedid)) return 0;
    return 
1;


Código PHP:
erroerror 017undefined symbol "Nome"did you mean "Mode"



RE: Erro estranho - k2bi_YT - 28/08/2022

Creio que o erro esteja nessa linha:
Código PHP:
format(string,sizeof(string),"~w~O(A)_Jogador(a)_~r~%s[%d]_~w~matou_o(a)_~y~%s[%d]_~w~com_um_~g~HS"Nome(playerid), Nome(damagedid), playerid); 

Verifica essa função Nome(...) é valida, se nao terá que criar uma para retornar o nome do jogador

Código PHP:
static stock Nome(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNamesizeof Name);
    return 
Name;