Quote:
Originally Posted by fysiks
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:
if( g_skills[id] < 0 ) { g_skills[id] = 0 }
|
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)