örnek: Player /Sans'tan 12345 Exp Kazandi.
PHP Kod:
#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 /sans", "Cmd_GetXP")
register_clcmd("say_team /sans", "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) )
{
new iRandom = random_num(1, 10000)
crxranks_give_user_xp(id, iRandom)
CC_SendMessage(id, "Yasasin! &x04%i XP&x01 Kazandiniz!", iRandom)
TrieSetCell(g_tPlayers, g_szAuthId[id], true)
}
else
{
CC_SendMessage(id, "Bu komuta erisiminiz yok.")
}
}
else
{
CC_SendMessage(id, "Bu komutu &x07harita basina yalizca bir kez &x01kullanabilirsiniz")
}
return PLUGIN_HANDLED
}
)

