Native help
I'm trying to test some stuff but it doesn't work.
get_user_level(id) simply returns 0 while i set iLevel[33] = 5 in the main plugin. what's wrong? my include file is called level_test.inc Code:
Code:
Code:
|
Re: Native help
new iLevel[33] = {5, ...}
|
Re: Native help
Quote:
Well this was just to test something, thanks for your response. How should it be done in a level system with the same array structure? Native is meant to be used in a top 10 system. |
Re: Native help
The native is correct. What is not correct is how you initialize your variable(meaning the test is wrong).
new iLevel[33] = 5 will set only index 0 to 5, the others remain 0. That's why your native returns 0. To set the entire array you must use the syntax I provided. |
Re: Native help
Well, players are given a certain value when killing someone in-game with the plugin i'm trying to fix. So that should work shouldn't it?
for example Code:
Then why does it still show 0 in the top 10? |
Re: Native help
new iLevel[33] = 5
This will only set iLevel[0] to 5, which will be ignored since the plugin returns 0 if the id is 0. The native works as intended. Code:
Code:
Code:
iLevel[0]: 5 |
Re: Native help
Quote:
|
Re: Native help
this is the code that needs to be fixed. This isn't my code, just edited the accuracy part into the level part but it doesn't work. get_player_level() is made like i posted before in the test version. The only difference is that i don't set iLevel[33] = 5, iLevel[33] changes all the time when players level up killing people.
PHP Code:
|
Re: Native help
bump
|
Re: Native help
Quote:
OP, this won't work since you're only getting the last id that was set in players[32] by get_players.
Spoiler
:arrow:
Spoiler
|
| All times are GMT -4. The time now is 04:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.