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

Solved [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resolved.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-01-2018 , 23:18   [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resolved.
Reply With Quote #1

Button works once after opening server But since then, it won't work until the server is closed. I cannot see the problem, so I ask you a question.

Code:
new bool:AccessEKey[MAXPLAYERS+1] = false;
public Action:OnPlayerRunCmd(Client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)	
{
	if(buttons & IN_USE)
	{
		if(AccessEKey[Client] == false)
		{
			if(!PrethinkBuffer[Client])
			{
				if (classtype[Client] == 3)
				{
					CommandUse(Client);
					
					PrethinkBuffer[Client] = true;
					
					AccessEKey[Client] = true;
				}	
			}
			if(classtype[Client] == 1)
			{
				if(!boomuse[Client])
				{
					grenadeattack(Client);
					boomuse[Client] = true;
					AccessEKey[Client] = true;
				}
			}
		}
	}
	else
	{
		AccessEKey[Client] = false;
	}
}

Last edited by kdaekiss; 09-09-2018 at 00:11. Reason: 변수를 늦게하여 해결하였습니다
kdaekiss is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-02-2018 , 01:07   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #2

You haven't shown any code that sets PrethinkBuffer or boomuse to false.
Fyren is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-03-2018 , 06:34   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #3

Quote:
Originally Posted by Fyren View Post
You haven't shown any code that sets PrethinkBuffer or boomuse to false.
Code:
public Action:RounStart(Handle:event, const String:Name[], bool:Broadcast)
{
	for(new i = 1; i <= MaxClients; i++)
	{
		if(AliveCheck(i))
		{
			boomuse[i] = false;
		}
	}
}
Here's the code. It's a personal matter.

No syntax for the corresponding PresetBuffer code has been added. Then I wonder why the boomuse below does not work.
I'll give it to you at round start.

I want that function to be used as a one-time function. please refer

It's late. Here's the code.

Last edited by kdaekiss; 09-03-2018 at 07:25. Reason: Additional
kdaekiss is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-03-2018 , 19:38   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #4

Players may have not spawned / be alive at round start.

Remove the alive check and see if that fixes your issue.
__________________
Neuro Toxin is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 09-04-2018 , 12:46   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #5

Also would be helpful if u showed your alive check code as well...if u want help all corresponding code should be available to check for errors.
MasterMind420 is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-07-2018 , 07:07   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
Players may have not spawned / be alive at round start.

Remove the alive check and see if that fixes your issue.
The variable is alive. I think the classtype variable is wrong. I got a hint. Thank you!

Last edited by kdaekiss; 09-07-2018 at 07:08. Reason: fix
kdaekiss is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-07-2018 , 07:13   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #7

Quote:
Originally Posted by MasterMind420 View Post
Also would be helpful if u showed your alive check code as well...if u want help all corresponding code should be available to check for errors.
I am sorry if you feel uncomfortable. I'm not good yet. Please excuse me.
And I've erased the check to be alive, but the result is the same.
kdaekiss is offline
kdaekiss
Junior Member
Join Date: Sep 2017
Old 09-07-2018 , 07:48   Re: [CS:S]Hello, I am asking you that the error for OnPlayerRunCmd has not been resol
Reply With Quote #8

Quote:
Originally Posted by Neuro Toxin View Post
Players may have not spawned / be alive at round start.

Remove the alive check and see if that fixes your issue.
Code:
public Action:RounStart(Handle:event, const String:Name[], bool:Broadcast)
{
	for(new i = 1; i <= MaxClients; i++)
	{
		chooseclass(i);
		weapontype[i] = 0;
		damageplus[i] = 0.0;
		classtype[i] = 0;
		boomuse[i] = false;
		PrethinkBuffer[i] = false;
	}
}
No. boomuse[i] = false; PrethinkBuffer[i] = false;

I don't think these two variables are really something. Debugging.

Code:
new bool:AccessEKey[MAXPLAYERS+1] = false;
public Action:OnPlayerRunCmd(Client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)	
{
	if(buttons & IN_USE)
	{
		if(IsClientInGame(Client) && IsPlayerAlive(Client))
		{
			if(AccessEKey[Client] == false)
			{
				if(classtype[Client] == 1)
				{
					if(!PrethinkBuffer[Client])
					{
						CommandUse(Client);
						
						PrethinkBuffer[Client] = true;
						
						AccessEKey[Client] = true;
					}
				}	
				if(classtype[Client] == 3)
				{
					if(!boomuse[Client])
					{
						grenadeattack(Client);
						boomuse[Client] = true;
						AccessEKey[Client] = true;
					}
				}
			}
		}
	}
	else
	{
		AccessEKey[Client] = false;
	}
}
It seems that you are not exceeding the parameter check statement. It works. I put it back in, it doesn't work.
kdaekiss 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 12:14.


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