User
Pass
2FA
 
 

[REZOLVAT]cerere plugin free money

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message1147
Bhupesh

[Mentally Stable]



Status: Offline
(since 31-08-2021 07:06)
Joined: 27 Jul 2017
Posts: 21, Topics: 12
Location: India

Reputation: 36.8

Post Posted: 05-09-2017, 10:58:52 | Translate post to: ... (Click for more languages)

Name: Free Money
Plugin description: I need for my furien server which give free 16000 money by writing /free in chat and after that i can get money after 24 hours when i write /free
More details:
Example:

0 0
  
Back to top
View user's profile Send private message
destroi112

[DEV]



Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042, Topics: 119
Location: ---------

Reputation: 515.9
Votes: 118

   
Post Posted: 08-09-2017, 05:34:49 | Translate post to: ... (Click for more languages)

Try this ->
Spoiler:

Another method much shorter :
Code:

#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();
         }
      }
   }
}

Cvars :
free_money_amount and free_money_time
This plugin will save all users who use this command in vault and delete them after 24h.This way I can check if the user already used the command or not.



Retired from Amxmodx

0 0
  
Back to top
View user's profile Send private message
Bhupesh

[Mentally Stable]



Status: Offline
(since 31-08-2021 07:06)
Joined: 27 Jul 2017
Posts: 21, Topics: 12
Location: India

Reputation: 36.8

Post Posted: 08-09-2017, 21:01:08 | Translate post to: ... (Click for more languages)

Thanks For the Plugin It Is Working Allright ! -
0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by GoreSpintecatoru., 08 September 2017 19:44



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 10-05-2024, 04:37:45
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x