[server] Implement and match n_gpci(...)

This commit is contained in:
RD42 2024-04-28 22:32:25 +08:00
parent 362480c54e
commit ea1a2cb2b3
2 changed files with 14 additions and 2 deletions

View File

@ -54,6 +54,11 @@ public:
return m_bPlayerSlotState[playerId];
};
PCHAR GetPlayerClientID(PLAYERID playerId) {
if(playerId >= MAX_PLAYERS) { return NULL; }
return m_szPlayerClientID[playerId];
};
void ResetPlayerScoresAndMoney() {
memset(&m_iPlayerScore[0],0,sizeof(int) * MAX_PLAYERS);
memset(&m_iPlayerMoney[0],0,sizeof(int) * MAX_PLAYERS);

View File

@ -3,10 +3,17 @@
#define CHECK_PARAMS(n)
int set_amxstring(AMX *amx,cell amx_addr,const char *source,int max);
//----------------------------------------------------------------------------------
// native gpci(playerid, const clientid[], len)
static cell AMX_NATIVE_CALL n_gpci(AMX *amx, cell *params)
{
// TODO: gpci
return 0;
PLAYERID playerId = (PLAYERID)params[1];
if (playerId >= MAX_PLAYERS || !pNetGame->GetPlayerPool()->GetSlotState(playerId)) return 0;
return set_amxstring(amx, params[2], pNetGame->GetPlayerPool()->
GetPlayerClientID(playerId), params[3]);
}
//----------------------------------------------------------------------------------