Jump to content

Plugin Bonus Csgo Remake


Shadows Adi

Recommended Posts

  • Scripters

Descriere: Acesta este un plugin care ofera jucatorilor o anumita suma de pulberi dupa un anumit timp. Functioneaza doar pentru modul CSGO Remake by Nubo.

 

Sursa:

#include <amxmodx>
#include <cstrike>
#include <nvault>

#pragma tabsize 0

new scraps_amount,time_delete,g_Vault;
new const Tag[] = "[CSGO REMAKE]";

#pragma compress 1

native csgor_get_user_dusts(id);
native csgor_set_user_dusts(id, amount);
native csgor_is_user_logged(id);

public plugin_init()
{
   register_plugin("/bonus Plugin","1.0","Shadows Adi");
   register_clcmd("say /bonus","give_money");
   scraps_amount = register_cvar("scraps_amount","10");
   time_delete = register_cvar("scrpas_time","12");//timpul in ore
   
}

public plugin_cfg()
{
   g_Vault = nvault_open("Bonus_Data");
   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)
{
	if(csgor_is_user_logged(id))
	{
		new name[33];
		new dusts = csgor_get_user_dusts(id);
		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" );
			csgor_set_user_dusts(id,dusts + get_pcvar_num(scraps_amount));
			ChatColor(id,"!g%s!y Ai primit !g%d SCRAPS !ypoti folosi comanda din nou peste !team%d ore",Tag, get_pcvar_num(scraps_amount),  get_pcvar_num(time_delete));
		}
		else
		{
			ChatColor(id,"!g%s!y Deja ai folosit comanda odata. Incerca iar in !g%d ore !ypentru a primi SCRAPS.",Tag, get_pcvar_num(time_delete));
			return PLUGIN_HANDLED;
		}
	}
	else 
	{
		ChatColor(id, "!g%s!y You need to be !glogged in !yin order to receive your bonus!",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();
         }
      }
   }
}

 

Descarcare: MediaFire

 

Cvar-uri:


scraps_amount "10" //Cate pulberi primeste jucatorul
scraps_time "12" //Dupa cate ore poate folosi din nou comanda 

 

Comenzi in chat: say /bonus

 

Alte precizari: Stocarea datelor se face prin nVault, iar fisierul vault in care se salveaza se numeste "Bonus_Data".

 

Module necesare: 


#include <amxmodx>
#include <cstrike>
#include <nvault>

 

Pentru alte nelamuriri, postati aici, nu in PM, Multumesc.

Edited by Shadows Adi
  • Like 1
Link to comment
Share on other sites

  • 2 months later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use & Privacy Policy