Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions src/CPlayerData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ bool CPlayerData::SetPlayerTeamForPlayer(WORD teamplayerid, int team)
return true;
}

bool CPlayerData::ResetPlayerMarkerForPlayer(WORD resetplayerid)
{
CPlayer *p = pNetGame->pPlayerPool->pPlayer[resetplayerid];

RakNet::BitStream bs;
bs.Write(resetplayerid);
bs.Write(p->dwNickNameColor);
pRakServer->RPC(&RPC_SetPlayerColor, &bs, HIGH_PRIORITY, RELIABLE_ORDERED, 0, pRakServer->GetPlayerIDFromIndex(wPlayerID), 0, 0);
return true;
}

int CPlayerData::GetPlayerTeamForPlayer(WORD teamplayerid)
{
CPlayer *p = pNetGame->pPlayerPool->pPlayer[teamplayerid];
Expand Down
2 changes: 2 additions & 0 deletions src/CPlayerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class CPlayerData
CPlayerData(WORD playerid);
~CPlayerData(void);

bool ResetPlayerMarkerForPlayer(WORD resetplayerid);

bool SetPlayerTeamForPlayer(WORD teamplayerid, int team);
int GetPlayerTeamForPlayer(WORD teamplayerid);
inline void ResetPlayerTeam(WORD playerid) { m_iTeams[playerid] = -1; }
Expand Down
1 change: 1 addition & 0 deletions src/RPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int RPC_WorldPlayerRemove = 163;
int RPC_ChatBubble = 0x3B;
int RPC_SetPlayerSkin = 0x99;
int RPC_SetPlayerName = 0x0B;
int RPC_SetPlayerColor = 72;
int RPC_SetFightingStyle = 0x59;
int RPC_ScrApplyAnimation = 0x56;
int RPC_ClientMessage = 0x5D;
Expand Down
1 change: 1 addition & 0 deletions src/RPCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extern int RPC_WorldPlayerRemove;
extern int RPC_ChatBubble;
extern int RPC_SetPlayerSkin;
extern int RPC_SetPlayerName;
extern int RPC_SetPlayerColor;
extern int RPC_SetFightingStyle;
extern int RPC_ScrApplyAnimation;
extern int RPC_ClientMessage;
Expand Down
16 changes: 16 additions & 0 deletions src/Scripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,22 @@ static cell AMX_NATIVE_CALL Natives::SetPlayerChatBubbleForPlayer( AMX* amx, cel
return 0;
}

// native ResetPlayerMarkerForPlayer(playerid, resetplayerid)
static cell AMX_NATIVE_CALL Natives::ResetPlayerMarkerForPlayer(AMX* amx, cell* params)
{
// If unknown server version
if (!pServer)
return 0;

CHECK_PARAMS(2, "ResetPlayerMarkerForPlayer");

int playerid = static_cast<int>(params[1]);
int resetplayerid = static_cast<int>(params[2]);

if (!IsPlayerConnectedEx(playerid) || !IsPlayerConnectedEx(resetplayerid)) return 0;
return pPlayerData[playerid]->ResetPlayerMarkerForPlayer(static_cast<WORD>(resetplayerid));
}

// native SetPlayerVersion(playerid, version[];
static cell AMX_NATIVE_CALL Natives::SetPlayerVersion( AMX* amx, cell* params )
{
Expand Down
1 change: 1 addition & 0 deletions src/Scripting.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ namespace Natives
static cell AMX_NATIVE_CALL AddPlayerForPlayer(AMX *amx, cell *params); // R17
static cell AMX_NATIVE_CALL RemovePlayerForPlayer(AMX *amx, cell *params); // R17
static cell AMX_NATIVE_CALL SetPlayerChatBubbleForPlayer(AMX *amx, cell *params); // R10
static cell AMX_NATIVE_CALL ResetPlayerMarkerForPlayer(AMX *amx, cell *params); // R17
static cell AMX_NATIVE_CALL SetPlayerVersion(AMX *amx, cell *params); // R9
static cell AMX_NATIVE_CALL IsPlayerSpawned(AMX *amx, cell *params); // R9
static cell AMX_NATIVE_CALL IsPlayerControllable(AMX *amx, cell *params); // R11
Expand Down