Undefined symbol: GetName
#1

Well, I used this code:

Код:
 
public OnPlayerText(playerid, text[])
{
    new
        message[128];
    format(message, sizeof(message), "%s says: %s", GetName(playerid), text);
    ProxDetector(30.0, playerid, message, -1);
    return 0;
}
And I get this error:

Код:
C:\Users\PC\Desktop\MyGM\gamemodes\GM.pwn(130) : error 017: undefined symbol "GetName"
Help will be appreciated.
Reply
#2

You didn't define getting the players name....
Reply
#3

It isnt defined...

pawn Код:
stock GetName(playerid);
{
    new szName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, szName, sizeof(szName));
    return szName;
}
Add that to the script.
Reply
#4

Ok thanks Ryan, will try now.
Reply
#5

I've received these errors after using your code:

Код:
C:\Users\Yakir\Desktop\The Best Server\gamemodes\GM.pwn(130) : error 004: function "GetName" is not implemented
C:\Users\Yakir\Desktop\The Best Server\gamemodes\GM.pwn(329) : error 055: start of function body without function header
C:\Users\Yakir\Desktop\The Best Server\gamemodes\GM.pwn(331) : error 021: symbol already defined: "GetPlayerName"
C:\Users\Yakir\Desktop\The Best Server\gamemodes\GM.pwn(332) : error 010: invalid function or declaration
C:\Users\Yakir\Desktop\The Best Server\gamemodes\GM.pwn(335) : warning 203: symbol is never used: "szName"
Reply
#6

Remove the ";" in on the first line of the stock.
Reply
#7

Done, it complied, Thanks guys.
Reply
#8

fail : omg the bump sorry
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)