[Ajuda] error 017: undefined symbol "PlayerName"
#1

Eu coloquei um cуdigo para funcionar o /infolideres esse:

Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");
    static Orgg[30];
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    for(new i; i<MAX_ORG; i++){
        format(Orgg,60,"Org %d",i);
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}
Tudo em seus lugares direitinho.
Mas deu um erro:

Код:
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13274) : error 017: undefined symbol "PlayerName"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Alguem me ajuda ?
Estou comesando a entender codigo pawno agora ^^
Reply
#2

tenta assim ..
pawn Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    new PlayerName[MAX_PLAYER_NAME];
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");
    static Orgg[30];
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    for(new i; i<MAX_ORG; i++){
        format(Orgg,60,"Org %d",i);
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}
Obs: Eu nunca vi um sistema de dini, entao vo tentar ajudar ..
Reply
#3

Код:
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13269) : error 012: invalid function call, not a valid address
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13269) : warning 215: expression has no effect
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13269) : error 001: expected token: ";", but found ")"
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13269) : error 029: invalid expression, assumed zero
C:\Users\Vinycius Christian\Desktop\Geral RP 0.3e\gamemodes\POU.pwn(13269) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Deu mais errado SAHUHUASAHUS
Por sorte tenho um backup de antes...
Mas se souber resolver poste ai por favor. Adoro sua ajuda ^^
Reply
#4

Posta a linha 13269 ae.
Reply
#5

Код:
Linha 13268     format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
Linha 13269     dini_Set("Lider.ini",Orgg,PlayerName(pid));
}
Reply
#6

pawn Код:
PlayerName ( playerid )
{
        new str_name [ MAX_PLAYER_NAME ] ;
        GetPlayerName ( playerid, str_name, MAX_PLAYER_NAME ) ;
       
        return str_name;
}
Reply
#7

Posto isso substituindo oque ?
Reply
#8

Quote:
Originally Posted by Nill.Oliveira
Посмотреть сообщение
tenta assim ..
pawn Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    new PlayerName[MAX_PLAYER_NAME];
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");
    static Orgg[30];
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    for(new i; i<MAX_ORG; i++){
        format(Orgg,60,"Org %d",i);
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}
Obs: Eu nunca vi um sistema de dini, entao vo tentar ajudar ..
Vocк nгo sabe usar static

pawn Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");

    static Orgg[30]; Orgg[0] = '\0';
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    static Orgg[30];
    for(new i; i<MAX_ORG; i++){
        Orgg[0] = '\0';
        format(Orgg,60,"Org %d",i);
        Orgg[0] = '\0';
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}

stock PlayerName(p){
        static pName[24];
        return (GetPlayerName(p, pName, 24), pName);
}
Reply
#9

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Vocк nгo sabe usar static

pawn Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");

    static Orgg[30]; Orgg[0] = '\0';
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    static Orgg[30];
    for(new i; i<MAX_ORG; i++){
        Orgg[0] = '\0';
        format(Orgg,60,"Org %d",i);
        Orgg[0] = '\0';
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}

stock PlayerName(p){
        static pName[24];
        return (GetPlayerName(p, pName, 24), pName);
}
Tambйm nгo deu erro nenhum.
Mas tambйm nгo funcionou /infolideres no servidor
Reply
#10

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Vocк nгo sabe usar static

pawn Код:
#define MAX_ORG 30

Lider(para1);

stock Lider(pid){
    if(!dini_Exists("Lider.ini")) dini_Create("Lider.ini");

    static Orgg[30]; Orgg[0] = '\0';
    format(Orgg,30,"Org %d",PlayerInfo[pid][pMember]);
    dini_Set("Lider.ini",Orgg,PlayerName(pid));
}


stock VerLider(playerid){
    static Orgg[30];
    for(new i; i<MAX_ORG; i++){
        Orgg[0] = '\0';
        format(Orgg,60,"Org %d",i);
        Orgg[0] = '\0';
        format(Orgg2,60,"Lider Org: %d - %s",i,dini_Get("Lider.ini",Orgg);
        SendClientMessage(playerid,COLOR_WHITE,Orgg2);
    }
}

stock PlayerName(p){
        static pName[24];
        return (GetPlayerName(p, pName, 24), pName);
}
Se for usar format nгo precisa igualar a EOS.

O mesmo vale para funзхes como GetPlayerHealth, GetPlayerArmour, GetPlayerWeaponData etc, onde os parвmetros sгo passados por referкncia jб assumindo novos valores.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)