give xp plugin error
Posted: 22 Jan 2020, 15:53
@Raheem can you help me?
L 01/20/2020 - 19:46:16: [AMXX] Displaying debug trace (plugin "ze_give_xp.amxx", version "1.0")
L 01/20/2020 - 19:46:16: [AMXX] Run time error 10: native error (native "ze_set_user_xp")
L 01/20/2020 - 19:46:16: [AMXX] [0] ze_give_xp.sma::Cmd_GiveXP (line 35)
L 01/20/2020 - 19:46:16: [AMXX] Displaying debug trace (plugin "ze_give_xp.amxx", version "1.0")
L 01/20/2020 - 19:46:16: [AMXX] Run time error 10: native error (native "ze_set_user_xp")
L 01/20/2020 - 19:46:16: [AMXX] [0] ze_give_xp.sma::Cmd_GiveXP (line 35)
- #include <zombie_escape>
- #include <ze_levels>
- #define ACCESS ADMIN_RCON
- public plugin_init ()
- {
- register_plugin("[ZE] Give XP", "1.0", "?")
- register_clcmd("ze_givexp", "Cmd_GiveXP", ACCESS, "- ze_givexp <name> <amount>")
- }
- public Cmd_GiveXP(id)
- {
- if (!(get_user_flags(id) & ACCESS))
- {
- client_print(id, print_console, "You have no access to that command")
- return PLUGIN_HANDLED
- }
- new szName[32], szAmount[10]
- read_argv (1, szName, charsmax (szName))
- read_argv (2, szAmount, charsmax (szAmount))
- new iTargetIndex = get_user_index(szName)
- if (!iTargetIndex)
- {
- client_print(id, print_console, "[ZE] Player not found!")
- return PLUGIN_HANDLED
- }
- new iXPAmout = str_to_num (szAmount)
- ze_set_user_xp(iTargetIndex, ze_get_user_xp(iTargetIndex) + iXPAmout)
- return PLUGIN_HANDLED
- }