Skill points become negative
2 Attachment(s)
Parameters inside each_health 1
I changed it to each_health 5 There is only 1 skill point, and 5 parts can be deducted. Skill points will become -4 How to solve it? |
Re: Skill points become negative
If you need to just make sure that the value doesn't go below zero, you can add a check after every location that subtracts a value such as this:
PHP Code:
|
Re: Skill points become negative
Quote:
Thank you, boss But after I modified it (modify the life part first) If you click on it, there will be no response and the menu will be closed. It has now been changed to 100 skill points will be deducted by 100 and will no longer be negative. But the points need to be 0 to be displayed. There are not enough points. If it is 1, the menu will be closed directly. if(g_hp[id] >= 100) { client_printc(id, "\g血量已升至最高等級了!!!") cmd_skills(id) } else if(g_skills[id] >= 100) { g_skills[id] -= get_cvar_num("each_health") g_hp[id] ++ cmd_skills(id) } else if(!g_skills[id]) { client_printc(id, "\g沒有足夠的技能點數") cmd_skills(id) |
Re: Skill points become negative
No idea what you just said.
|
Re: Skill points become negative
Quote:
If the remaining points are 1 or less than 100, click the skill and the menu will close. |
Re: Skill points become negative
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:
|
Re: Skill points become negative
Quote:
PHP Code:
According to your method, no errors occurred when converting files. Then I modified it myself and it was successful. |
Re: Skill points become negative
Quote:
val = clamp( the value , minimum , maximum ) val will always result in a value between min and max. |
All times are GMT -4. The time now is 18:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.