PHP Code:
public OnPluginStart()
{
HookEvent("item_pickup", OnItemPickup);
}
public Action:OnItemPickup(Handle:event, const String:name[], bool:dontBroadcast)
{
/* Your code here */
}
You have two variants to get their weapons:
PHP Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
/* Variant 1 */
/* Print weaponname without "weapon_" */
new String:ItemName[32];
GetEventString(event,"item",ItemName,sizeof(ItemName));
PrintToChat(client,"item: %s", ItemName);
/* Variant 2 */
/* Print weaponname with "weapon_" */
new String:sWeapon[32];
GetClientWeapon(client, sWeapon, sizeof(sWeapon));
PrintToChat(client,"weapon: %s", sWeapon);
__________________