Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #if defined _playername_included
- #endinput
- #endif
- #define _playername_included
- #if MAX_PLAYERS == 500 //If MAX_PLAYER is changed already in a_samp, don't change it back to 500 ;)
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 500 //Optional: Change this to the max players of your server for better perfomance.
- #endif
- new playerName[MAX_PLAYERS][MAX_PLAYER_NAME];
- forward _PNAME_PlayerConnect(playerid);
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid, playerName[playerid], MAX_PLAYER_NAME);
- return 1;
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect _PNAME_PlayerConnect
- stock NewName(playerid, const name[])
- {
- new str[MAX_PLAYER_NAME];
- format(str, MAX_PLAYER_NAME, "x_%03d_", playerid);
- SetPlayerName(playerid, str); //Eg. if you have the name 'kwarde' and you want 'Kwarde', normal SetPlayerName won't work. This'll fix it
- SetPlayerName(playerid, name);
- GetPlayerName(playerid, playerName[playerid], MAX_PLAYER_NAME);
- return 1;
- }
- #define SetPlayerName NewName
- stock PlayerName(playerid)
- return playerName[playerid];
- #define Name PlayerName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement