Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<amxmodx>
- #include<cstrike>
- #include<nvault>
- #pragma tabsize 0
- new money_amount,time_delete,g_Vault;
- new const Tag[] = "[ServerName]";
- public plugin_init()
- {
- register_plugin("Free Money","D3luxe","1.0");
- register_clcmd("say /free","give_money");
- money_amount = register_cvar("free_money_amount","16000");
- time_delete = register_cvar("free_money_time","24");//this is in hours
- }
- public plugin_cfg()
- {
- g_Vault = nvault_open("SaveData");
- if(g_Vault == INVALID_HANDLE)
- set_fail_state("Error opening nVault");
- nvault_prune(g_Vault,0,get_systime() - ((60 * 60) * get_pcvar_num(time_delete)));
- }
- public plugin_end()
- {
- nvault_close(g_Vault);
- }
- public give_money(id)
- {
- new name[33];
- get_user_name(id,name,charsmax(name));
- new iTimestamp , szVal[ 10 ];
- if(!nvault_lookup( g_Vault , name , szVal , charsmax( szVal ) , iTimestamp ) || ( iTimestamp && ( ( get_systime() - iTimestamp ) >= ((60 * 60) * get_pcvar_num(time_delete)))))
- {
- nvault_set( g_Vault , name , "moneyFree" );
- cs_set_user_money(id,get_pcvar_num(money_amount));
- ChatColor(id,"!g%s!yYou just got 16000$ u can use this command again in !team24h",Tag);
- }else{
- ChatColor(id,"!g%s!yYou already used this command u need to wait at least !g24h !yto use it again.",Tag);
- return PLUGIN_HANDLED;
- }
- return PLUGIN_HANDLED;
- }
- //stock chatcolor
- stock ChatColor(const id, const input[], any:...)
- {
- new count = 1, players[32]
- static msg[191]
- vformat(msg, 190, input, 3)
- replace_all(msg, 190, "!g", "^4")
- replace_all(msg, 190, "!y", "^1")
- replace_all(msg, 190, "!team", "^3")
- if (id) players[0] = id; else get_players(players, count, "ch")
- {
- for (new i = 0; i < count; i++)
- {
- if (is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
Add Comment
Please, Sign In to add comment