Skip to content

SetPlayerName Hooks #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sscanf2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,31 @@ forward OnCachedInit();
CHAIN_FORWARD:SSCANF_OnPlayerDisconnect(playerid, reason) = 1;
#endif

/**
* <library>sscanf</library>
* <remarks>
* Called when player name changes.
* </remarks>
*/
stock SSCANF__SetPlayerName(playerid, const name[])
{
new
SSCANF_value = SetPlayerName(playerid, name)
;

if (SSCANF_value == 1 && SSCANF_gInit == 1)
{
SSCANF_Join(playerid, name, bool:IsPlayerNPC(playerid));
}
return SSCANF_value;
}
#if defined _ALS_SetPlayerName
#undef SetPlayerName
#else
#define _ALS_SetPlayerName
#endif
#define SetPlayerName SSCANF__SetPlayerName

// Ensure that these purely internal natives can't be called from outside this
// include.
#define SSCANF_Init
Expand Down