This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Skill points become negative


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupid0303
Junior Member
Join Date: Sep 2012
Location: Taiwan
Old 05-02-2024 , 20:57   Re: Skill points become negative
Reply With Quote #1

Quote:
Originally Posted by Napoleon_be View Post
It would be more helpful if you could just explain correctly what you're looking for. I would say it looks like chinese but your code is literally that.

fysiks already gave u the answer more or less on the "question" u asked.

PHP Code:
if(g_skills[id] < 0
{
    
g_skills[id] = 0;
    
// client_printc()
}

else if (
g_skills[id] < 100
{
    
// click skill & close menu?



PHP Code:
if(g_skills[id] >= //Click the skill point amount
{
g_skills[id] -= get_cvar_num("each_health")

}
else
if(
g_skills[id] < //If it is lower than this value, it will show that there are insufficient skill points and the menu will not disappear. 
Thank u
According to your method, no errors occurred when converting files.
Then I modified it myself and it was successful.
stupid0303 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-04-2024 , 11:18   Re: Skill points become negative
Reply With Quote #2

Quote:
Originally Posted by stupid0303 View Post
PHP Code:
if(g_skills[id] >= //Click the skill point amount
{
g_skills[id] -= get_cvar_num("each_health")

}
else
if(
g_skills[id] < //If it is lower than this value, it will show that there are insufficient skill points and the menu will not disappear. 
Thank u
According to your method, no errors occurred when converting files.
Then I modified it myself and it was successful.
Chief, another option you have is using clamp()

val = clamp( the value , minimum , maximum )

val will always result in a value between min and max.
__________________
Bugsy 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 09:25.


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