mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-09-19 20:26:14 +08:00
[server] Implement/match n_GetPlayerName(...)
This commit is contained in:
@ -48,6 +48,11 @@ public:
|
|||||||
return m_bPlayerSlotState[playerId];
|
return m_bPlayerSlotState[playerId];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PCHAR GetPlayerName(PLAYERID playerId) {
|
||||||
|
if(playerId >= MAX_PLAYERS) { return NULL; }
|
||||||
|
return m_szPlayerName[playerId];
|
||||||
|
};
|
||||||
|
|
||||||
PCHAR GetPlayerClientID(PLAYERID playerId) {
|
PCHAR GetPlayerClientID(PLAYERID playerId) {
|
||||||
if(playerId >= MAX_PLAYERS) { return NULL; }
|
if(playerId >= MAX_PLAYERS) { return NULL; }
|
||||||
return m_szPlayerClientID[playerId];
|
return m_szPlayerClientID[playerId];
|
||||||
|
@ -1009,10 +1009,13 @@ static cell AMX_NATIVE_CALL n_IsPlayerInAnyVehicle(AMX *amx, cell *params)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// native GetPlayerName(playerid, const name[], len)
|
||||||
static cell AMX_NATIVE_CALL n_GetPlayerName(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_GetPlayerName(AMX *amx, cell *params)
|
||||||
{
|
{
|
||||||
// TODO: GetPlayerName
|
PLAYERID playerId = (PLAYERID)params[1];
|
||||||
return 0;
|
if (playerId > MAX_PLAYERS || !pNetGame->GetPlayerPool()->GetSlotState(playerId)) return 0;
|
||||||
|
return set_amxstring(amx, params[2], pNetGame->GetPlayerPool()->
|
||||||
|
GetPlayerName(playerId), params[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL n_SetPlayerCheckpoint(AMX *amx, cell *params)
|
static cell AMX_NATIVE_CALL n_SetPlayerCheckpoint(AMX *amx, cell *params)
|
||||||
|
Reference in New Issue
Block a user