mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[server] Implement/match n_GetPlayerName(...)
This commit is contained in:
parent
f74fc485c4
commit
d60dc61013
@ -48,6 +48,11 @@ public:
|
||||
return m_bPlayerSlotState[playerId];
|
||||
};
|
||||
|
||||
PCHAR GetPlayerName(PLAYERID playerId) {
|
||||
if(playerId >= MAX_PLAYERS) { return NULL; }
|
||||
return m_szPlayerName[playerId];
|
||||
};
|
||||
|
||||
PCHAR GetPlayerClientID(PLAYERID playerId) {
|
||||
if(playerId >= MAX_PLAYERS) { return NULL; }
|
||||
return m_szPlayerClientID[playerId];
|
||||
|
@ -1009,10 +1009,13 @@ static cell AMX_NATIVE_CALL n_IsPlayerInAnyVehicle(AMX *amx, cell *params)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// native GetPlayerName(playerid, const name[], len)
|
||||
static cell AMX_NATIVE_CALL n_GetPlayerName(AMX *amx, cell *params)
|
||||
{
|
||||
// TODO: GetPlayerName
|
||||
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()->
|
||||
GetPlayerName(playerId), params[3]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL n_SetPlayerCheckpoint(AMX *amx, cell *params)
|
||||
|
Loading…
Reference in New Issue
Block a user