Raised This Month: $32 Target: $400
 8% 

[CSGO] Timer is not activating while Reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bayshades
Member
Join Date: Sep 2019
Old 11-17-2022 , 03:27   [CSGO] Timer is not activating while Reload
Reply With Quote #1

Code:
public Action OnPlayerRunCmd(int client, int &buttons)
{
    if (IsPlayerAlive(client))
    {
        if (buttons & IN_RELOAD)
        {
			if(bEnable)
			{
				int iUserID = client;
				if(GetClientOfUserId(iUserID)) CreateTimer(4.0, Timer_Spawn, iUserID, TIMER_FLAG_NO_MAPCHANGE);
			}
        }
    }
}
Heres my code and it does not activate FixAmmo stock after 4 seconds while Player running reload button cmd. Could you guys help me please?
and yes bEnable is 1


Code:
public Action OnPlayerRunCmd(int client, int &buttons)
{
    if (IsPlayerAlive(client))
    {
        if (buttons & IN_RELOAD)
        {
			if(bEnable)
			{
				int iUserID = client;
				if(GetClientOfUserId(iUserID)) CreateTimer(4.0, Timer_Spawn, iUserID, TIMER_FLAG_NO_MAPCHANGE);
			}
        }
    }
}
The problem is in this part of my code i guess. Does anyone have an idea?

Last edited by bayshades; 11-17-2022 at 07:28.
bayshades is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-17-2022 , 05:33   Re: [CSGO] Timer is not activating while Reload
Reply With Quote #2

Change:
PHP Code:
                int iUserID client;
                if(
GetClientOfUserId(iUserID)) CreateTimer(4.0Timer_SpawniUserIDTIMER_FLAG_NO_MAPCHANGE); 
To:
PHP Code:
                CreateTimer(4.0Timer_SpawnGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE); 
__________________
Silvers is offline
bayshades
Member
Join Date: Sep 2019
Old 11-17-2022 , 07:27   Re: [CSGO] Timer is not activating while Reload
Reply With Quote #3

Thanks. It works.
bayshades 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 07:10.


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