SA-MP Forums Archive
Not showing the name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not showing the name (/showthread.php?tid=122326)



Not showing the name - Perker12345 - 21.01.2010

pawn Код:
new playername[MAX_PLAYER_NAME];
    new string[256];
        switch(reason)
      {
        case 0: format(string, sizeof(string), "%s has left the server. (Timeout)", playername);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", playername);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", playername);
      }
        ProxDetector(60.0, playerid, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);
It just says has left the server.
How could i make it say the name?


Re: Not showing the name - JoeDaDude - 21.01.2010

Use https://sampwiki.blast.hk/wiki/GetPlayerName


Re: Not showing the name - Kwarde - 21.01.2010

Yeah what he said, so it must be this:

pawn Код:
new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof playername);
    new string[256];
        switch(reason)
      {
        case 0: format(string, sizeof(string), "%s has left the server. (Timeout)", playername);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", playername);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", playername);
      }
        ProxDetector(60.0, playerid, string, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY, COLOR_GREY);



Re: Not showing the name - KnooL - 21.01.2010

pawn Код:
new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername));
    new string[256];
        switch(reason)
      {
        case 0: format(string, sizeof(string), "%s has left the server. (Timeout)", playername);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", playername);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", playername);
      }
refixed


Re: Not showing the name - Streetplaya - 21.01.2010

Quote:
Originally Posted by KnooL
pawn Код:
new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername));
    new string[256];
        switch(reason)
      {
        case 0: format(string, sizeof(string), "%s has left the server. (Timeout)", playername);
        case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", playername);
        case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", playername);
      }
refixed
you actually don't need ( ) with sizeof since it's some compiler construct


Re: Not showing the name - Perker12345 - 21.01.2010

Thank you for the fast replies It works now, thanks again.