Raised This Month: $ Target: $400
 0% 

[CS:S] Player pick-up weapon event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
exCeeder.
Junior Member
Join Date: May 2013
Location: .
Old 05-31-2013 , 14:39   Re: [CS:S] Player pick-up weapon event
Reply With Quote #1

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(clientsWeaponsizeof(sWeapon));
    
    
PrintToChat(client,"weapon: %s"sWeapon); 
__________________
Best regards,
eXceeder

Last edited by exCeeder.; 05-31-2013 at 16:14.
exCeeder. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode