Hoi, I did that, hope it will help
PHP Code:
#include <sourcemod>
#include <sdkhooks>
public OnPluginStart() {
HookEvent("player_death", EventPlayerDeath, EventHookMode_Pre);
}
public Action EventPlayerDeath(Event event, const char[] name, bool dontBroadcast) {
char buffer[255];
if (GetEventString(event, "weapon", buffer, sizeof(buffer)) && buffer[255] > 0) {
if (buffer[0]) {
SetEventString(event, "weapon", buffer[0]);
}
else {
return Plugin_Handled;
}
}
return Plugin_Continue;
}
Oh and if I did some mistakes, feel free to correct it :^)
EDIT: I'm not sure if this will work (since I can't reproduce the exact situtation, but it can help (hope so))