Cerere Plugin /GET

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
ChristianEvo
Membru, skill +1
Membru, skill +1
Posts: 208
Joined: 13 Jul 2015, 14:57
Detinator Steam: Da
CS Status: BB Force
Detinator server CS: EVO.MANIACS.RO
SteamID: eVo_style
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 2 times
Contact:

20 Jul 2022, 23:10

Plugin Cerut: Get Bonus
Descriere (adica ce face el mai exact): Folosec un plugin care da ofera un mic bonus tastand /get. Acest plugin ofera doar XP, insa eu as vrea sa dea atat XP cat si credite..
Serverul impune conditii strict HLDS/REHLDS?: ReHLDS
Ai cautat pluginul?(daca da, precizeaza cum): Da
Necesita mod special?: Nu
Configuratie server: BaseBuilder
Versiune AMXX: 1.8.

Plugin
| Afiseaza codul
#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 /get", "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, "&x03You received &x04%i XP&x01!", iRandom)
            TrieSetCell(g_tPlayers, g_szAuthId[id], true)
        }
        else
        {
            CC_SendMessage(id, "&x03You have no access to this command.")
        }
    }
    else
    {
        CC_SendMessage(id, "&x03You can only use this command once per map!")
    }

    return PLUGIN_HANDLED
}
.inc credite :
| Afiseaza codul
#if defined _fcs_included
	#endinput
#endif

#define _fcs_included



/*
 * Returns a players credits
 * 
 * @param		client - The player index to get points of
 * 
 * @return		The credits client
 * 
 */

native fcs_get_user_credits(client);

/*
 * Sets <credits> to client
 * 
 * @param		client - The player index to set points to
 * @param		credits - The amount of credits to set to client
 * 
 * @return		The credits of client
 * 
 */

native fcs_set_user_credits(client, credits);

/*
 * Adds <credits> points to client
 * 
 * @param		client - The player index to add points to
 * @param		credits - The amount of credits to add to client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_add_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}

/*
 * Subtracts <credits>  from client
 * 
 * @param		client - The player index to subtract points from
 * @param		credits - The amount of credits to substract from client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_sub_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
.inc xp
| Afiseaza codul
#define _crxranks_included

#if !defined _crxranks_const_included
    #include <crxranks_const>
#endif

/**
 * Called when the client's level changes.
 *
 * @param id	 		Client index.
 * @param level 		New level.
 * @param levelup		True if the client gained a level, false if he lost one.
 * @noreturn
 */
forward crxranks_user_level_updated(id, level, bool:levelup)

/**
 * Called right before the client receives XP.
 *
 * @param id	 		Client index.
 * @param xp	 		Amount of XP ready to be received.
 * @param source	 	The XP source.
 * @return              CRXRANKS_STOP to prevent the XP from being added,
 *                      CRXRANKS_CONTINUE to let the XP pass through,
 *                      any integer value to modify the amount of XP that
 *                      is going to be received
 */
forward crxranks_user_receive_xp(id, xp, CRXRanks_XPSources:source)

/**
 * Called right after the client's XP amount changes.
 *
 * @param id	 		Client index.
 * @param xp	 		Amount of XP the client has after the change.
 * @param source	 	The XP source that caused the change.
 * @noreturn
 */
forward crxranks_user_xp_updated(id, xp, CRXRanks_XPSources:source)

/**
 * Returns the chat prefix set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the prefix in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_chat_prefix(buffer[], len)

/**
 * Returns the flags that clients will receive when they reach the final level.
 *
 * @param buffer	 	Buffer to store the flags in.
 * @param len 			Maximum buffer length.
 * @return				Flags as bit value.
 */
native crxranks_get_final_flags(buffer[] = "", len = 0)

/**
 * Returns the HUD info format set in the plugin's configuration file.
 *
 * @param final		 	If true, it will get the HUD_FORMAT_FINAL settings, otherwise HUD_FORMAT if false.
 * @param buffer	 	Buffer to store the HUD info format in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_hudinfo_format(bool:final, buffer[], len)

/**
 * Returns the number of available levels.
 *
 * @return				Number of available levels.
 */
native crxranks_get_max_levels()

/**
 * Searches for a rank name by a specific level number.
 *
 * @param level	 		Level number.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @return				0 if the level number is out of range, 1 otherwise.
 */
native crxranks_get_rank_by_level(level, buffer[], len)

/**
 * Returns the data saving type set in the plugin's configuration file.
 *
 * @note You can use the constants CRXRANKS_ST_NICKNAME, CRXRANKS_ST_IP
 *		 and CRXRANKS_ST_STEAMID instead of numbers.
 *
 * @return				0 if it's set to nickname, 1 for IP and 2 for SteamID.
 */
native CRXRanks_SaveTypes:crxranks_get_save_type()

/**
 * Returns a key value set in the [Settings] section in the plugin's configuration file.
 *
 * @param key	 		Key to search for.
 * @param value 	 	Buffer to store the value in.
 * @param len 			Maximum buffer length.
 * @return				True if the key was found, false otherwise.
 */
native bool:crxranks_get_setting(key[], value[], len)

/**
 * Returns the client's HUD information.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the HUD information in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_hudinfo(id, buffer[], len)

/**
 * Returns the client's current level.
 *
 * @param id		 	Client index.
 * @return				Client's current level.
 */
native crxranks_get_user_level(id)

/**
 * Returns the client's next rank.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_next_rank(id, buffer[], len)

/**
 * Returns the XP needed for the client to reach the next level.
 *
 * @param id		 	Client index.
 * @return 				XP needed for the client to reach the next level.
 */
native crxranks_get_user_next_xp(id)

/**
 * Returns the client's current rank.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_rank(id, buffer[], len)

/**
 * Returns the amount of XP that the client has.
 *
 * @param id		 	Client index.
 * @return				Client's current XP.
 */
native crxranks_get_user_xp(id)

/**
 * Returns the vault name set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the vault name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_vault_name(buffer[], len)

/**
 * Returns the VIP flags set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the flags in.
 * @param len 			Maximum buffer length.
 * @return				Flags as bit value.
 */
native crxranks_get_vip_flags(buffer[] = "", len = 0)

/**
 * Returns the amount of XP required for a specific level.
 *
 * @param level			Level number.
 * @return				-1 if the level is out of range, XP required for that level otherwise.
 */
native crxranks_get_xp_for_level(level)

/**
 * Returns the XP reward that the client will get in a specific sitaution.
 *
 * @param id		 	Client index.
 * @param reward		Reward keyword.
 * @return				XP reward that the client will get.
 */
native crxranks_get_xp_reward(id, reward[])

/**
 * Gives a specific amount of XP to the client.
 *
 * @note If the "reward" parameter is set, the plugin will ignore the amount set
 *       in the "amount" parameter and will attempt to give the XP set in the
 *		 configuration file by the specific keyword set in the "reward" parameter.
 *
 * @param id		 	Client index.
 * @param amount		XP amount.
 * @param reward		Reward keyword.
 * @param source		XP source.
 * @return				Amount of XP given.
 */
native crxranks_give_user_xp(id, amount = 0, reward[] = "", CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)

/**
 * Checks if the client has HUD information enabled.
 *
 * @param id			Client index.
 * @return				True if he has, false otherwise.
 */
native bool:crxranks_has_user_hudinfo(id)

/**
 * Checks if the HUD info system is using DHUD messages.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_hi_using_dhud()

/**
 * Checks if the HUD information system is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_hud_enabled()

/**
 * Checks if the screen fade when a client loses a level is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_sfdn_enabled()

/**
 * Checks if the screen fade when a client gains a level is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_sfup_enabled()

/**
 * Checks if the client is on the final level.
 *
 * @param id			Client index.
 * @return				True if he is, false otherwise.
 */
native bool:crxranks_is_user_on_final(id)

/**
 * Checks if the client is VIP according to the VIP flags set in the plugin's configuration file.
 *
 * @param id			Client index.
 * @return				True if he is, false otherwise.
 */
native bool:crxranks_is_user_vip(id)

/**
 * Checks if the plugin is using MySQL to save/load XP.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_using_mysql()

/**
 * Checks if the XP notifier system is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_xpn_enabled()

/**
 * Checks if the XP notifier system is using DHUD messages.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_xpn_using_dhud()

/**
 * Sets the exact amount of XP that th client has.
 *
 * @param id		 	Client index.
 * @param amount		XP amount.
 * @param source		XP source.
 * @return				Amount of XP given.
 */
native crxranks_set_user_xp(id, amount, CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)

/**
 * Checks if the plugin's option to use combined events is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_using_combined_events()

/**
 * Checks whether the specified XP reward is set in the configuration file.
 *
 * @param reward		The XP reward to check.
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_xp_reward_is_set(reward[])
RoyalServer
User avatar
kidd0x
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 1054
Joined: 06 Oct 2018, 14:41
Detinator Steam: Da
SteamID: /id/kidd0x/
Reputatie: Utilizator neserios (tepar!)
Fond eXtream: 0
Location: Constangeles
Discord: kidd0x
Has thanked: 172 times
Been thanked: 81 times

21 Jul 2022, 04:42

Code: Select all

#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

native fcs_get_user_credits(client)
native fcs_set_user_credits(client, credits)


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 /get", "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)
            new iRandom2 = random_num(1, 1000) // modifici tu aici minim si maxim
            crxranks_give_user_xp(id, iRandom)
            fcs_set_user_credits(id, fcs_get_user_credits(id) + iRandom2)
            CC_SendMessage(id, "&x03You received &x04%i XP&x01 & &x04%i Credits&x01!", iRandom, iRandom2)
            TrieSetCell(g_tPlayers, g_szAuthId[id], true)
        }
        else
        {
            CC_SendMessage(id, "&x03You have no access to this command.")
        }
    }
    else
    {
        CC_SendMessage(id, "&x03You can only use this command once per map!")
    }

    return PLUGIN_HANDLED
}
User avatar
CyBer[N]eTicK
Membru, skill +1
Membru, skill +1
Posts: 190
Joined: 29 May 2020, 05:35
Detinator Steam: Da
CS Status: Strong & Original
Detinator server CS: BB.BLACKGAMES.RO
SteamID: /id/cybernetick_cbk/
Fond eXtream: 0
Location: Albania, tirana
Discord: cybernetick_cbk
Has thanked: 21 times
Been thanked: 18 times
Contact:

21 Jul 2022, 10:48

ChristianEvo wrote:
20 Jul 2022, 23:10
Plugin Cerut: Get Bonus
Descriere (adica ce face el mai exact): Folosec un plugin care da ofera un mic bonus tastand /get. Acest plugin ofera doar XP, insa eu as vrea sa dea atat XP cat si credite..
Serverul impune conditii strict HLDS/REHLDS?: ReHLDS
Ai cautat pluginul?(daca da, precizeaza cum): Da
Necesita mod special?: Nu
Configuratie server: BaseBuilder
Versiune AMXX: 1.8.

Plugin
| Afiseaza codul
#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 /get", "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, "&x03You received &x04%i XP&x01!", iRandom)
            TrieSetCell(g_tPlayers, g_szAuthId[id], true)
        }
        else
        {
            CC_SendMessage(id, "&x03You have no access to this command.")
        }
    }
    else
    {
        CC_SendMessage(id, "&x03You can only use this command once per map!")
    }

    return PLUGIN_HANDLED
}
.inc credite :
| Afiseaza codul
#if defined _fcs_included
	#endinput
#endif

#define _fcs_included



/*
 * Returns a players credits
 * 
 * @param		client - The player index to get points of
 * 
 * @return		The credits client
 * 
 */

native fcs_get_user_credits(client);

/*
 * Sets <credits> to client
 * 
 * @param		client - The player index to set points to
 * @param		credits - The amount of credits to set to client
 * 
 * @return		The credits of client
 * 
 */

native fcs_set_user_credits(client, credits);

/*
 * Adds <credits> points to client
 * 
 * @param		client - The player index to add points to
 * @param		credits - The amount of credits to add to client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_add_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}

/*
 * Subtracts <credits>  from client
 * 
 * @param		client - The player index to subtract points from
 * @param		credits - The amount of credits to substract from client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_sub_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
.inc xp
| Afiseaza codul
#define _crxranks_included

#if !defined _crxranks_const_included
    #include <crxranks_const>
#endif

/**
 * Called when the client's level changes.
 *
 * @param id	 		Client index.
 * @param level 		New level.
 * @param levelup		True if the client gained a level, false if he lost one.
 * @noreturn
 */
forward crxranks_user_level_updated(id, level, bool:levelup)

/**
 * Called right before the client receives XP.
 *
 * @param id	 		Client index.
 * @param xp	 		Amount of XP ready to be received.
 * @param source	 	The XP source.
 * @return              CRXRANKS_STOP to prevent the XP from being added,
 *                      CRXRANKS_CONTINUE to let the XP pass through,
 *                      any integer value to modify the amount of XP that
 *                      is going to be received
 */
forward crxranks_user_receive_xp(id, xp, CRXRanks_XPSources:source)

/**
 * Called right after the client's XP amount changes.
 *
 * @param id	 		Client index.
 * @param xp	 		Amount of XP the client has after the change.
 * @param source	 	The XP source that caused the change.
 * @noreturn
 */
forward crxranks_user_xp_updated(id, xp, CRXRanks_XPSources:source)

/**
 * Returns the chat prefix set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the prefix in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_chat_prefix(buffer[], len)

/**
 * Returns the flags that clients will receive when they reach the final level.
 *
 * @param buffer	 	Buffer to store the flags in.
 * @param len 			Maximum buffer length.
 * @return				Flags as bit value.
 */
native crxranks_get_final_flags(buffer[] = "", len = 0)

/**
 * Returns the HUD info format set in the plugin's configuration file.
 *
 * @param final		 	If true, it will get the HUD_FORMAT_FINAL settings, otherwise HUD_FORMAT if false.
 * @param buffer	 	Buffer to store the HUD info format in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_hudinfo_format(bool:final, buffer[], len)

/**
 * Returns the number of available levels.
 *
 * @return				Number of available levels.
 */
native crxranks_get_max_levels()

/**
 * Searches for a rank name by a specific level number.
 *
 * @param level	 		Level number.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @return				0 if the level number is out of range, 1 otherwise.
 */
native crxranks_get_rank_by_level(level, buffer[], len)

/**
 * Returns the data saving type set in the plugin's configuration file.
 *
 * @note You can use the constants CRXRANKS_ST_NICKNAME, CRXRANKS_ST_IP
 *		 and CRXRANKS_ST_STEAMID instead of numbers.
 *
 * @return				0 if it's set to nickname, 1 for IP and 2 for SteamID.
 */
native CRXRanks_SaveTypes:crxranks_get_save_type()

/**
 * Returns a key value set in the [Settings] section in the plugin's configuration file.
 *
 * @param key	 		Key to search for.
 * @param value 	 	Buffer to store the value in.
 * @param len 			Maximum buffer length.
 * @return				True if the key was found, false otherwise.
 */
native bool:crxranks_get_setting(key[], value[], len)

/**
 * Returns the client's HUD information.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the HUD information in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_hudinfo(id, buffer[], len)

/**
 * Returns the client's current level.
 *
 * @param id		 	Client index.
 * @return				Client's current level.
 */
native crxranks_get_user_level(id)

/**
 * Returns the client's next rank.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_next_rank(id, buffer[], len)

/**
 * Returns the XP needed for the client to reach the next level.
 *
 * @param id		 	Client index.
 * @return 				XP needed for the client to reach the next level.
 */
native crxranks_get_user_next_xp(id)

/**
 * Returns the client's current rank.
 *
 * @param id		 	Client index.
 * @param buffer	 	Buffer to store the rank name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_user_rank(id, buffer[], len)

/**
 * Returns the amount of XP that the client has.
 *
 * @param id		 	Client index.
 * @return				Client's current XP.
 */
native crxranks_get_user_xp(id)

/**
 * Returns the vault name set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the vault name in.
 * @param len 			Maximum buffer length.
 * @noreturn
 */
native crxranks_get_vault_name(buffer[], len)

/**
 * Returns the VIP flags set in the plugin's configuration file.
 *
 * @param buffer	 	Buffer to store the flags in.
 * @param len 			Maximum buffer length.
 * @return				Flags as bit value.
 */
native crxranks_get_vip_flags(buffer[] = "", len = 0)

/**
 * Returns the amount of XP required for a specific level.
 *
 * @param level			Level number.
 * @return				-1 if the level is out of range, XP required for that level otherwise.
 */
native crxranks_get_xp_for_level(level)

/**
 * Returns the XP reward that the client will get in a specific sitaution.
 *
 * @param id		 	Client index.
 * @param reward		Reward keyword.
 * @return				XP reward that the client will get.
 */
native crxranks_get_xp_reward(id, reward[])

/**
 * Gives a specific amount of XP to the client.
 *
 * @note If the "reward" parameter is set, the plugin will ignore the amount set
 *       in the "amount" parameter and will attempt to give the XP set in the
 *		 configuration file by the specific keyword set in the "reward" parameter.
 *
 * @param id		 	Client index.
 * @param amount		XP amount.
 * @param reward		Reward keyword.
 * @param source		XP source.
 * @return				Amount of XP given.
 */
native crxranks_give_user_xp(id, amount = 0, reward[] = "", CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)

/**
 * Checks if the client has HUD information enabled.
 *
 * @param id			Client index.
 * @return				True if he has, false otherwise.
 */
native bool:crxranks_has_user_hudinfo(id)

/**
 * Checks if the HUD info system is using DHUD messages.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_hi_using_dhud()

/**
 * Checks if the HUD information system is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_hud_enabled()

/**
 * Checks if the screen fade when a client loses a level is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_sfdn_enabled()

/**
 * Checks if the screen fade when a client gains a level is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_sfup_enabled()

/**
 * Checks if the client is on the final level.
 *
 * @param id			Client index.
 * @return				True if he is, false otherwise.
 */
native bool:crxranks_is_user_on_final(id)

/**
 * Checks if the client is VIP according to the VIP flags set in the plugin's configuration file.
 *
 * @param id			Client index.
 * @return				True if he is, false otherwise.
 */
native bool:crxranks_is_user_vip(id)

/**
 * Checks if the plugin is using MySQL to save/load XP.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_using_mysql()

/**
 * Checks if the XP notifier system is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_xpn_enabled()

/**
 * Checks if the XP notifier system is using DHUD messages.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_is_xpn_using_dhud()

/**
 * Sets the exact amount of XP that th client has.
 *
 * @param id		 	Client index.
 * @param amount		XP amount.
 * @param source		XP source.
 * @return				Amount of XP given.
 */
native crxranks_set_user_xp(id, amount, CRXRanks_XPSources:source = CRXRANKS_XPS_PLUGIN)

/**
 * Checks if the plugin's option to use combined events is enabled.
 *
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_using_combined_events()

/**
 * Checks whether the specified XP reward is set in the configuration file.
 *
 * @param reward		The XP reward to check.
 * @return				True if it is, false otherwise.
 */
native bool:crxranks_xp_reward_is_set(reward[])
-> Este asemanator la fel ca cel de sus, dar ca acesta este pe cvar poti seta direct de pe server intre cate credite si xp sa dea.

Code: Select all

#include <amxmodx>
#include <cromchat>
#include <crxranks>
#include <fcs>

#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]

new  
    pCvarRandomCredite,
    pCvarRandomXp;

public plugin_init()
{
    register_plugin("CRXRanks: GetXP Cmd", "1.0", "OciXCrom")
    register_clcmd("say /get", "Cmd_GetXP")
    register_clcmd("say_team /getxp", "Cmd_GetXP")
    crxranks_get_chat_prefix(CC_PREFIX, charsmax(CC_PREFIX))
    g_tPlayers = TrieCreate()

    pCvarRandomCredite  = register_cvar("bb_random_credite", "5000");
    pCvarRandomXp       = register_cvar("bb_random_xp", "5000");
}

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 RandomCredite = random_num(50, get_cvar_num(pCvarRandomCredite));
            new RandomXp = random_num(50, get_cvar_num(pCvarRandomXp));
            crxranks_give_user_xp(id, RandomXp)
            fcs_set_user_credits(id, fcs_get_user_credits(id) + RandomCredite)
            CC_SendMessage(id, "&x03You received &x04%i XP&x01! & %d credits", RandomXp, RandomCredite);
            TrieSetCell(g_tPlayers, g_szAuthId[id], true)
        }
        else
        {
            CC_SendMessage(id, "&x03You have no access to this command.")
        }
    }
    else
    {
        CC_SendMessage(id, "&x03You can only use this command once per map!")
    }

    return PLUGIN_HANDLED
}

Code: Select all

amx_cvar bb_random_credite 5000 - Ofera intre 50 si 5000 de credite
amx_cvar bb_random_xp 5000 - Ofera la fel intre 50 si 5000 xp
Daca vrei o suma mai mare de 50 modific la -> random_num(50
User avatar
ChristianEvo
Membru, skill +1
Membru, skill +1
Posts: 208
Joined: 13 Jul 2015, 14:57
Detinator Steam: Da
CS Status: BB Force
Detinator server CS: EVO.MANIACS.RO
SteamID: eVo_style
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 2 times
Contact:

21 Jul 2022, 19:12

Se poate da T/C.
Il folosesc pe cel facut de N3v3rM1nd.
Cel facut de CyBer[N]eTicK da erare la compilere.
Multumesc amandurora.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests