User
Pass
2FA
 
 

Propunere Timeout.

 
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 -> Trash
Author Message488
[LGD]DoctorwhO

[Mentally Stable]



Status: Offline
(since 07-03-2018 22:46)
Joined: 03 Mar 2015
Posts: 289, Topics: 34
Location: Timisoara

Reputation: 60.8
Votes: 8

       
Post Posted: 14-04-2015, 13:39:13 | Translate post to: ... (Click for more languages)

Hristos A Inviat Lume -
Am gasit o comanda pe net ( amx_timeout ) asta le strica cs jucatorilor si as vrea sa fie adaugata pentru a nu ne mai chinui sa le dam ban botiilor care tot intra sa faca reclama si codatiilor.
Sursa ->

Code:
#include <amxmodx>
#include <amxmisc>

#define USE_nVAULT   1 // 0 - dezactivezi modul nVault
#if USE_nVAULT == 1
#include <nvault>
#endif

#define USE_LOGS   1 // 0 - nu mai creaza 'logs'
#if USE_LOGS == 1
static BaseDir[64], LogsDir[64], File[64]
#endif

#define PLUGIN       "New TimeOUT Target"
#define VERSION    "1.0-T"

#define CharsMax(%1)   sizeof %1 - 1
#define ADMIN_ACCESS   ADMIN_MAP

new g_Target[33]

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, "P.Of.Pw")
   register_concmd("amx_timeout", "timeout_cmd", ADMIN_ACCESS, "- <name>")
   register_concmd("amx_untimeout", "untimeout_cmd", ADMIN_ACCESS, "- <name>")
   register_event("ResetHUD", "hook_resethud", "be")
}

public timeout_cmd(id, level, cid)
{
   if(!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED
     
   new arg[32]
   read_argv(1, arg, 31)
   
   new target = cmd_target(id, arg, 8)
   if(!target)
      return PLUGIN_HANDLED
   if(g_Target[target])
      return PLUGIN_HANDLED
     
   g_Target[target] = 1
#if USE_nVAULT == 1   
   Save(target)
#endif   
   client_cmd(target,"cl_timeout 0")
   
   new admin_name[32], target_name[32], admin_ip[32], target_ip[32]
   
   get_user_name(id, admin_name, CharsMax(admin_name))
   get_user_name(target, target_name, CharsMax(target_name))
   get_user_ip(id, admin_ip, CharsMax(admin_ip), 1)
   get_user_ip(target, target_ip, CharsMax(target_ip), 1)

#if USE_LOGS == 1   
   log_to_file(File, "Admin: ^"%s^" (%s) Target On [timeout]: ^"%s^" (%s)", admin_name, admin_ip, target_name, target_ip)
#endif
   console_print(id, "Comanda executata pe: ^"%s^"", target_name)
   return PLUGIN_HANDLED
}

public untimeout_cmd(id, level, cid)
{
   if(!cmd_access(id, level, cid, 2))
      return PLUGIN_HANDLED
     
   new arg[32]
   read_argv(1, arg, 31)
   
   new target = cmd_target(id, arg, 8)
   if(!target)
      return PLUGIN_HANDLED
   if(!g_Target[target])
      return PLUGIN_HANDLED
     
   g_Target[target] = 0
#if USE_nVAULT == 1   
   Save(target)
#endif   
   client_cmd(target,"cl_timeout 35")

   new admin_name[32], target_name[32], admin_ip[32], target_ip[32]
   
   get_user_name(id, admin_name, CharsMax(admin_name))
   get_user_name(target, target_name, CharsMax(target_name))
   get_user_ip(id, admin_ip, CharsMax(admin_ip), 1)
   get_user_ip(target, target_ip, CharsMax(target_ip), 1)

#if USE_LOGS == 1   
   log_to_file(File, "Admin: ^"%s^" (%s) UN-Target On [un-timeout]: ^"%s^" (%s)", admin_name, admin_ip, target_name, target_ip)
#endif
   console_print(id, "Comanda executata pe: ^"%s^"", target_name)
   return PLUGIN_HANDLED
}

public hook_resethud(id)
{
   if(g_Target[id])
      client_cmd(id,"cl_timeout 0")
   
   return PLUGIN_CONTINUE
}

#if USE_nVAULT == 1
public client_putinserver(id)
   Load(id)
#endif
#if USE_nVAULT == 1   
public Save(index)
{
   new Vault = nvault_open("time_out")
   new Key[64], Value[64], Ip[32]
   
   get_user_ip(index, Ip, 31, 1)
   
   formatex(Key, sizeof Key - 1, "%s-time_out:", Ip)
   formatex(Value, sizeof Value - 1, "%d", g_Target[index])
   
   nvault_set(Vault, Key, Value)
   nvault_close(Vault)
}
#endif
#if USE_nVAULT == 1
public Load(index)
{
   new Vault = nvault_open("time_out")
   new Key[64], Value[64], Ip[32]
   
   get_user_ip(index, Ip, 31, 1)
   formatex(Key, sizeof Key - 1, "%s-time_out:", Ip)
   
   nvault_get(Vault, Key, Value, 31)
   nvault_close(Vault)
   
   g_Target[index] = str_to_num(Value)
}
#endif
#if USE_LOGS == 1
public plugin_cfg()
{   
   get_basedir(BaseDir, CharsMax(BaseDir))
   
   formatex(LogsDir, CharsMax(LogsDir), "%s/configs/TIME-OUT=LOGS", BaseDir)
   formatex(File, CharsMax(File), "%s/Log.log", LogsDir)
   
   if(!dir_exists(LogsDir))
      mkdir(LogsDir)
   
   if(!file_exists(File))
      write_file(File, "; TIME-OUT! New Punish user's! LOG's FILE.", -1)   
}
#endif

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
vars

[Mentally Stable]



Status: Offline
(since 01-07-2016 14:03)
Joined: 12 Jan 2015
Posts: 186, Topics: 27
Location: Timisoara

Reputation: 59
Votes: 5

Post Posted: 14-04-2015, 17:59:47 | Translate post to: ... (Click for more languages)

:pro: stiu de aceasta comanda , chiar pe un sv a fost folosita comanda pe mine , fiind ''cal de bataie'' , adica eu am vrut sa ajut detinatoru - .
Nustiu dar credca se va folosi abuziv , si de exemplu daca un admin cu acces da time out la toti , ca adminu ala , nu mai stiu cum il cheama care a dat ban la tot sv, in acest caz contra.
Ca sa fie pro , sa aiba acces owneri ceva grad mare:)

0 0
  
Back to top
View user's profile Send private message
[LGD]DoctorwhO

[Mentally Stable]



Status: Offline
(since 07-03-2018 22:46)
Joined: 03 Mar 2015
Posts: 289, Topics: 34
Location: Timisoara

Reputation: 60.8
Votes: 8

       
Post Posted: 15-04-2015, 13:18:06 | Translate post to: ... (Click for more languages)

vars wrote:
:pro: stiu de aceasta comanda , chiar pe un sv a fost folosita comanda pe mine , fiind ''cal de bataie'' , adica eu am vrut sa ajut detinatoru - .
Nustiu dar credca se va folosi abuziv , si de exemplu daca un admin cu acces da time out la toti , ca adminu ala , nu mai stiu cum il cheama care a dat ban la tot sv, in acest caz contra.
Ca sa fie pro , sa aiba acces owneri ceva grad mare:)


Nu prea cred ca se va folosi abuziv, si chiar daca s-ar folosi, acest plugin creeaza un fisier unde arata cine a dat si pe ce motiv.

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
Zm|Smantana

[Creep]



Status: Offline
(since 18-01-2022 20:23)
Joined: 23 Jun 2014
Posts: 759, Topics: 29
Location: Romania

Reputation: 141.4
Votes: 11

     
Post Posted: 15-04-2015, 20:01:19 | Translate post to: ... (Click for more languages)

Pro dar sa fie bagata de la Moderator.
0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
-Skrillex-

[Screwed Freak]



Status: Offline
(since 27-11-2019 20:07)
Joined: 19 Apr 2014
Posts: 2988, Topics: 53
Location: Buzau

Reputation: 582.4
Votes: 29

   
Post Posted: 16-04-2015, 16:32:14 | Translate post to: ... (Click for more languages)

Pro, ca sunt prea multi care fac reclama pe sv si n-ai cu ce sa ii pedepsesti...
0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
DriNNker
[Banned user]


Banned


Status: Offline
(since 17-08-2015 23:16)
Joined: 23 Oct 2014
Posts: 764, Topics: 23
Location: Romania

Reputation: 136.4
Votes: 12

   
Post Posted: 16-04-2015, 18:06:30 | Translate post to: ... (Click for more languages)

Pro idem Smantana sa fie bagata de la Moderator .

Gandeste-te de 2 ori pana sa spui ceva sau sa faci ceva !


Zp.Freakz.Ro [Best server]
0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
***FLORIN***
[Banned user]


Banned


Status: Offline
(since 07-04-2018 07:49)
Joined: 26 Jan 2013
Posts: 1036, Topics: 87
Location: Craiova

Reputation: 460.9
Votes: 59

     
Post Posted: 16-04-2015, 21:14:54 | Translate post to: ... (Click for more languages)

Nu mi se pare geva genial..
Vb cu bodo. -




Sunt Oltean in sange si in acte !
0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID

  Topic locked


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

Locked by ***FLORIN***, 16 April 2015 19:15



 
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 -> Trash  


The time now is 27-04-2024, 08:51:20
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