Approved Set Player Level

Plug-ins compatibility with Zombie Escape 1.x only!


Post Reply
User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

Set Player Level

#1

Post by Raheem » 6 years ago

Set Player Level

Description:
  • Plugin for admins, So they can set levels for any player.
Installation & Instructions:
  • Simply install it like any plugin.
  • Usage: ze_setlevel "name" "level"
    Example: ze_setlevel "Raheem" 10 This will set my level to 10.
    You can change the admin flag from the plugin and then Re-Compile the plugin again:
    #define ACCESS ADMIN_RCON
  • This plugin require Levels System to work. Also it's recommended to set this cvar in levels system:
    ze_new_level_zero_xp 1
Downloads:
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#2

Post by johnnysins2000 » 6 years ago

Is it not better if u do it inside the Level xp system instead of making external plugin?
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#3

Post by Raheem » 6 years ago

I see this better, I don't like make all in one or we was done in our mod... But you see alot of sources just to simple things.
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#4

Post by johnnysins2000 » 6 years ago

Raheem wrote: 6 years ago I see this better, I don't like make all in one or we was done in our mod... But you see alot of sources just to simple things.
OK
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#5

Post by Raheem » 6 years ago

And sure bro if it's in one source we call functions one time but with this i see the difference can be neglected...
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#6

Post by Spir0x » 6 years ago

this plugin cannot be updated ?
simple example:

!tADMIN !g%s !tHas gived Player !g%s Level !g%d!y.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#7

Post by Spir0x » 6 years ago

[mention]Raheem[/mention] look here.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#8

Post by Spir0x » 5 years ago

I'm the only one who faced a problem on this plugin ? when i'm at any level 0 or 1 or 2 or 3.
when i give my self another level next round i'cant see weapons menu it will be hided. it's a bug.

Note: i'm using this cvar: ze_new_level_zero_xp 1

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#9

Post by johnnysins2000 » 5 years ago

Spir0x wrote: 5 years ago I'm the only one who faced a problem on this plugin ? when i'm at any level 0 or 1 or 2 or 3.
when i give my self another level next round i'cant see weapons menu it will be hided. it's a bug.

Note: i'm using this cvar: ze_new_level_zero_xp 1
I have not yet used this plugin... But if I face bug like yours I will report
Nobody Is That Busy If They Make Time :roll:

User avatar
tmv
Member
Member
Russia
Posts: 36
Joined: 4 years ago
Contact:

#10

Post by tmv » 4 years ago

When you enter a comment without a name and amount, this message will be appears

Code: Select all

[ZE] Invalid Player id (7)
[AMXX] Displaying debug trace (plugin "ze_set_player_level.amxx", version "1.0")
[AMXX] Run time error 10: native error (native "ze_set_user_level")
[AMXX]    [0] ze_set_player_level.sma::Cmd_SetLevel (line 35)

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#11

Post by Raheem » 4 years ago

tmv wrote: 4 years ago When you enter a comment without a name and amount, this message will be appears

Code: Select all

[ZE] Invalid Player id (7)
[AMXX] Displaying debug trace (plugin "ze_set_player_level.amxx", version "1.0")
[AMXX] Run time error 10: native error (native "ze_set_user_level")
[AMXX]    [0] ze_set_player_level.sma::Cmd_SetLevel (line 35)
I forget to check if user connected or not, that's why this error thrown, fixed here:
    1. #include <zombie_escape>
    2. #include <ze_levels>
    3.  
    4. #define ACCESS ADMIN_RCON
    5.  
    6. public plugin_init ()
    7. {
    8.     register_plugin("[ZE] Set Player Level", "1.0", "Raheem")
    9.     register_clcmd("ze_setlevel", "Cmd_SetLevel", ACCESS, "- ze_setlevel <name> <amount>")
    10. }
    11.  
    12. public Cmd_SetLevel(id)
    13. {
    14.     if (!(get_user_flags(id) & ACCESS))
    15.     {
    16.         client_print(id, print_console, "You have no access to that command")
    17.         return PLUGIN_HANDLED
    18.     }
    19.    
    20.     new szName[32], szAmount[10]
    21.    
    22.     read_argv (1, szName, charsmax (szName))
    23.     read_argv (2, szAmount, charsmax (szAmount))
    24.    
    25.     new iTargetIndex = get_user_index(szName)
    26.    
    27.     if (!is_user_connected(iTargetIndex))
    28.         return PLUGIN_HANDLED
    29.    
    30.     if (!iTargetIndex)
    31.     {
    32.         client_print(id, print_console, "[ZE] Player not found!")
    33.         return PLUGIN_HANDLED
    34.     }
    35.    
    36.     new iLevel = str_to_num (szAmount)
    37.    
    38.     ze_set_user_level(iTargetIndex, iLevel)
    39.  
    40.     return PLUGIN_HANDLED
    41. }
He who fails to plan is planning to fail

User avatar
VicKy
Mod Tester
Mod Tester
Pakistan
Posts: 87
Joined: 3 years ago
Contact:

#12

Post by VicKy » 3 years ago

Its have error when i give my self lvl just lvl up and one shoot = one lvl uping
and xp goes to - negative
Level system NOMAX
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#13

Post by Raheem » 3 years ago

VicKy wrote: 3 years ago Its have error when i give my self lvl just lvl up and one shoot = one lvl uping
and xp goes to - negative
Level system NOMAX
This because you use high ze_maxlevels_increment, which will result in very high max-xp that cannot be stored in a variable. To understand, in PAWN any integer number has 4 byte to be stored in. Which mean maximum number that can be stored is nearly 2,147,483,648; 2 billions. The variable will not be able to store more because this number is represented in 32 bits.

When for example you use ze_maxlevels_increment 2.0, and try to set user level to 50, the max-xp exceeds 2,147,483,648 and things get wrong. So in fact this number cannot be reached by a player by any way.

So the solution is to reduce ze_maxlevels_increment to value like 1.1, and with this setting make sure not to exceed level 100.

Practical example, use these settings: If level go higher than 92, the max-xp will exceed the allowed number that can be stored in a variable, and you get wrong results.

If you will use No-MAXXP version then you need to take look at this: viewtopic.php?f=7&t=3422
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 0 guests