View Single Post
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-10-2022 , 07:21   Re: [REQ] getxp for OcixCrom xp system
Reply With Quote #5

@lexzor - Re-joining the server will allow for the command to be used again.

Code:
#include <amxmodx> #include <cromchat> #include <crxranks> #if !defined MAX_AUTHID_LENGTH     const MAX_AUTHID_LENGTH = 64 #endif #if !defined MAX_PLAYERS     const MAX_PLAYERS = 32 #endif new Trie:g_tPlayers new g_szAuthId[MAX_PLAYERS][MAX_AUTHID_LENGTH] public plugin_init() {     register_plugin("CRXRanks: GetXP Cmd", "1.0", "OciXCrom")     register_clcmd("say /getxp", "Cmd_GetXP")     register_clcmd("say_team /getxp", "Cmd_GetXP")     crxranks_get_chat_prefix(CC_PREFIX, charsmax(CC_PREFIX))     g_tPlayers = TrieCreate() } public plugin_end() {     TrieDestroy(g_tPlayers) } public client_authorized(id) {     get_user_authid(id, g_szAuthId[id], charsmax(g_szAuthId[])) } public Cmd_GetXP(id) {     if(!TrieKeyExists(g_tPlayers, g_szAuthId[id]))     {         if(get_user_flags(id) & ADMIN_LEVEL_B)         {             new iRandom = random_num(50, 150)             crxranks_give_user_xp(id, iRandom)             CC_SendMessage(id, "Yay! You received &x04%i XP&x01!", iRandom)             TrieSetCell(g_tPlayers, g_szAuthId[id], true)         }         else         {             CC_SendMessage(id, "You have no access to this command.")         }     }     else     {         CC_SendMessage(id, "You can only use this command once per map!")     }     return PLUGIN_HANDLED }
__________________

Last edited by OciXCrom; 07-10-2022 at 07:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom