Raised This Month: $ Target: $400
 0% 

Weapon Time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-16-2008 , 12:20   Weapon Time
Reply With Quote #1

Hi friends, How I can know the most time that a player have a Usp, or a Knife?

Example: Is player have 5 minutes a Usp, But 7 minutes a Knife == a Knife?

It is posible a code

EDIT: In a period of time, check_weapon_start, check_weapon_end.
__________________

Last edited by AntiBots; 08-16-2008 at 14:39.
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-18-2008 , 19:45   Re: Weapon Time
Reply With Quote #2

PHP Code:
new g_UspCount[33];
public 
plugin_init() register_event("CurWeapon","event","be","1=1");
public 
event(id)
{
      
// Then, get the weapon id and check
     
new clipammo
     
new iwpn get_user_weapon(id,clip,ammo)
     
// If weapon is usp:
     
if(iwpn == CSW_USP)
     {
           
g_UspCount[id]++;
           if(
g_UspCount[id] >= 300)
           {
                    
// something
           
}
     }

PHP Code:
new Weapons[32];
new 
numWeaponsiweapon;
get_user_weapons(idWeaponsnumWeapons);
for (
i=0i<numWeaponsi++) 

   
weapon Weapons[i];
   if(
weapon == CSW_USP) { /*smth */ }

__________________

anakin_cstrike is offline
Reply


Thread Tools
Display Modes

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 03:16.


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