From d4b24be60440a50779f949b36ba111ec7d0d7db0 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:35:04 +0800 Subject: [PATCH] [server] Implement and match `n_GetWeaponName(...)` --- server/scrcustom.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index aa3b4dd..adb312d 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -381,10 +381,13 @@ static cell AMX_NATIVE_CALL n_SetWorldTime(AMX *amx, cell *params) return 0; } +// native GetWeaponName(weaponid, const weapon[], len) static cell AMX_NATIVE_CALL n_GetWeaponName(AMX *amx, cell *params) { - // TODO: GetWeaponName - return 0; + CHECK_PARAMS(3); + if(params[1] > WEAPON_COLLISION) return 0; + + return set_amxstring(amx,params[2],pNetGame->GetWeaponName(params[1]),params[3]); } //----------------------------------------------------------------------------------