Raised This Month: $51 Target: $400
 12% 

BuyHook ammo change globaly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-19-2011 , 12:44   BuyHook ammo change globaly
Reply With Quote #1

Solved. thx

Last edited by MindeLT; 10-20-2011 at 08:14.
MindeLT is offline
Send a message via Skype™ to MindeLT
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-19-2011 , 13:47   Re: BuyHook ammo change globaly
Reply With Quote #2

maybe use a timer or something? Maybe right when a weapon is purchased the buy triggers before the slot 0 is filled?
TnTSCS is offline
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-20-2011 , 05:29   Re: BuyHook ammo change globaly
Reply With Quote #3

Solved. Thx

Last edited by MindeLT; 10-20-2011 at 08:14.
MindeLT is offline
Send a message via Skype™ to MindeLT
psychonic

BAFFLED
Join Date: May 2008
Old 10-20-2011 , 08:55   Re: BuyHook ammo change globaly
Reply With Quote #4

Quote:
Originally Posted by MindeLT View Post
Hi,

trying to set 0 ammo reserve for every person, who's non VIP. In test server, only my friend get 10/0 set then he buyed awp and I 10/30, despite that i had no flags added.

PHP Code:
 public OnPluginStart()
 {
 
ammoOffset FindSendPropInfo("CCSPlayer""m_iAmmo");
 }

 public 
OnClientPostAdminCheck(client)
 { 
 if(
IsClientInGame(client))
 {
 if (
GetUserFlagBits(client) & g_AdmFlag)
 
g_bAllowed[client] = true;
 else
 
g_bAllowed[client] = false;
 }
 }
 public 
Action:BuyHook(clientargs)
 {
 if (
g_enabled)
 {
 if ( !
g_Can_Zoom )
 {
 new 
slot0;

 new 
String:weaponname[32];
 
GetClientWeapon(clientweaponnamesizeof(weaponname));

 
slot0 GetPlayerWeaponSlot(client0);

 if (
slot0 != -1// main weapon
 
{
 if (
StrEqual(weaponname"weapon_awp"false))
 {
 if(!
g_bAllowed[client])
 {
 
SetEntData(clientammoOffset + (5*4), 0);
 }
 }
 return 
Plugin_Continue;
 }
 return 
Plugin_Continue;
 }
 return 
Plugin_Continue;
 }
 return 
Plugin_Continue;
 } 
Any options? Thx
Quote:
Originally Posted by MindeLT View Post
Used timer, didnt helped.
Added some text to let me know know, which function is not executed. My friend get all text printed, ant mine stoped before slot 0 function. Any suggestions?

Quote:
Maybe right when a weapon is purchased the buy triggers before the slot 0 is filled?
Could you explain me further? How could i fix this? It might be an option.


P.S I just noticed, that after buying awp second time(in same round), ammo sets to */10 normally. So the problem is somewhere in BuyHook... Still dunno.


Please don't remove post content just because you got an answer.

Last edited by psychonic; 10-20-2011 at 08:56.
psychonic is offline
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-20-2011 , 12:50   Re: BuyHook ammo change globaly
Reply With Quote #5

Ok, i'll have in mind next time. Thx, psy.
MindeLT is offline
Send a message via Skype™ to MindeLT
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 00:32.


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