Any idea why this code doesn't work?
PHP Code:
|
Re: Any idea why this code doesn't work?
What doesn't work? You need to find which part doesn't work specifically. Is the function being called? What part of the code does and does not execute?
Also, your elseif will never be executed. You should combine the two and only change the part where the two codes differ. |
Re: Any idea why this code doesn't work?
Normal users should recieve X amount of jbpacks + Z amount (if killed with HS), VIP users (ADMIN_LEVEL_H) should recieve Y amount of jbpacks + Z amount (if killed with HS), but they don't.
Would you give me an example? |
Re: Any idea why this code doesn't work?
Try:
Code:
public fw_player_killed(victim, attacker, shouldgib, id) |
Re: Any idea why this code doesn't work?
Quote:
When something "doesn't work," you should always first check what code is actually being executed. If the whole function is not getting called at all then it doesn't do any good to change your code. So, you should find out what code is actually being executed. I typically do this by adding in server_print() statements describing what part just got executed (you can also use log_amx). Code:
function()E.g. If you never see anything print then you know that function() is not even being executed and you now know to look into why it's not being executed instead of looking inside the function which at that point would be irrelevant. If don't see what you expect to see from certain parts of the function then you know where to look into. So, after this process, you should not ever say "it doesn't work" because you should have it narrowed down to what does not work. |
Re: Any idea why this code doesn't work?
i think Ham_Killed forward have only 3 params and you made it with 4 params :S
|
Re: Any idea why this code doesn't work?
He didnt said what happens with him version so we cant help him 100%
But i think i know what him problem. He said he want for vips Y+Z and for who isnt vip X+Z Y= JBPACKS per kill of vips Z= JBPACKS per HS Kill X= JBPACKS per kill of normal user And i think what he says that is wrong is because he thinks this: g_jbpacks[attacker] += get_pcvar_num(g_killhsjp) is JBPACKS NORMAL/VIP + HS but in fact is just HS JBPACKS so what he should make is: Code:
public fw_player_killed(victim, attacker, shouldgib, id)- Per kill g_killjp - Per HS g_killhsjp And if player is VIP will receive: - Per kill g_killjpvip - Per HS g_killhsjpvip So if you want normal jp amount 10, you set g_killjp to 10, and if want hs 15 you set g_killhsjp to 15 and normal user will receive 15 jp per hs. Same thing to vip cvars Note: dont forget add the cvar g_killhsjpvip because that is wasnt on your code. And on your code, you had it changed, you had user get vip amount and vip get user amount, so use the version of this post ;) |
Re: Any idea why this code doesn't work?
X = Amount of jbpacks for normal users
Y = Amount of jpbacks for VIP users Z = HS kill amount. In all cases "Z" is a constant. @Jhob94 - why do you add "ADMIN_LEVEL_H" in both situations? And no. I didn't have it changed. In both situations players recieved "X" amount of jbpacks. |
Re: Any idea why this code doesn't work?
Listen i didnt add both is both situations, if you see, the first one have "!" before read the admin level, and that means if user isnt admin_level_h. And yes you had it changed because for vip you had normal jb amounts and for users you had vip amounts. Just read my post again and use the code, you will see that will work perfectly
|
Re: Any idea why this code doesn't work?
Code:
|
| All times are GMT -4. The time now is 20:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.