Ðead Øn Årrival
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Ðead Øn Årrival


 
HomeHomeLatest imagesSearchRegisterLog in

 

 Warning mod: A tool to make the lives of admins SIMPLE!

Go down 
2 posters
AuthorMessage
im the new guy

im the new guy



Warning mod: A tool to make the lives of admins SIMPLE! Empty
PostSubject: Warning mod: A tool to make the lives of admins SIMPLE!   Warning mod: A tool to make the lives of admins SIMPLE! Empty2009-11-21, 11:15

Hey guys, I have created a script that would be very valuable to admins.

This script is used to issue warnings to players who have done the wrong thing. An admin just types the command:
Code:
!warning
into chat to bring up a menu with a list of all players in it.

The admin selects the player he wishes to issue a warning to, and that's it. The script will issue a warning and display a message of how many warnings the player currently has. If the warning amount is the same as the temporary ban amount, or permanent ban amount (configured in script), the player is automatically banned for the amount of time specified (also configured in script). The warning count resets after the player is banned the second time.

For example, the temp ban time was set at 5 (5min), the the amount of warnings needed was 5. If the player was warned 5 times, the player would be banned for 5min.

The good thing with this script is that the warnings last as long as the data base script is in tact. It is saved after every map change, and even survives a server crash with all the information still saved on it!

To delete the current warning count for all players, you just need to delete the DB file in the folder the script is contained in: addons/eventscripts/warning/
Then type the command:
Code:
rcon es_keygroupdelete warning
into console, and wait for the next map change.

Anyway, here is the script. Hope it helps you out. Any dramas, just contact me in steam (fair few of u have me in there, as I don't check the forums to often anymore, after having hide n seek back online).

The script was originally made for the Hide N Seek mod, but can be used for all servers.

This requires the latest version of Mani Admin, and Eventscripts.

Enjoy!!

INSTALLATION:

Copy and paste the following text into a notepad file.
Name the file "Warning.txt"
Configure the first 5 lines on the script (where specified)
Add the line "es_load warning" into autoexec.cfg
restart server
Done!

Code:

block load
{
   // Edit the variable in 5 lines below.
   es_xsetinfo temp_ban_time 5 // EDIT ME: The amount of time the player is banned for.
   es_xsetinfo temp_ban_amount 5 // EDIT ME: The amount of warnings a player receives before a temp ban.
   es_xsetinfo perm_ban_amount 10 // EDIT ME: The amount of time the player is banned for [0 = permenant]
   es_xsetinfo perm_ban_time 100 // EDIT ME: The amount of warnings a player received before a perm ban.
   es_xsetinfo warning_admins "STEAM_0:1:14214794" // EDIT ME: Add your admins steam ID's here. Space them out like this: "STEAM:X:X:XXXXXXX ; STEAM:X:X:XXXXXXXXX ; STEAMX:X:XXXXXXXX"
   // Do not Edit Below Here.
   es_keygroupload warning |warning
   es_makepublic "Warning - created by I'm the new guy, go easy @ Hideexec.net"
   es_xmsg #multi #green[#lightgreenWarned#green]#default Loaded!
   es_xset playerlist_player 0
   es_xset playerlist_name 0
   es_xset playerlist_page 0
   es_xset playerlist_insline 0
   es_xset playerlist_chosen_player 0
   es_xset playerlist_new 0
   es_regsaycmd !warning "warning/warning_admin_check" description
}

block unload
{
   es_xset playerlist 0
   popup exists playerlist1 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist1
   popup exists playerlist2 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist2
   popup exists playerlist3 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist3
   popup exists playerlist4 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist4
   popup exists playerlist5 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist5
   popup exists playerlist6 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist6
   popup exists playerlist7 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist7
   popup exists playerlist8 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist8
   popup exists playerlist9 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist9
   popup exists playerlist10 playerlist
   if (server_var(playerlist) = 1) then popup delete playerlist10
   
   es_keygroupsave Warning |Warning
   es_keygroupdelete Warning
   es_unregsaycmd !warning
   es_xmsg #multi #green[#lightgreenWarned#green]#default Saved and Unloaded!
}

event es_map_start
{
   es_keygroupsave Warning |Warning
}

event player_activate
{
   es_xset group_exists 0
   es_exists group_exists keygroup Warning
   if (server_var(group_exists) == 0) do
   {
      es_keygroupcreate Warning
   }
   es_xset exists 0
   es_exists exists key Warning event_var(es_steamid)
   if (server_var(exists) == 0) do
   {
      es_keycreate Warning event_var(es_steamid)
      es_keysetvalue Warning event_var(es_steamid) warnings 0
   }
   es_keysetvalue Warning event_var(es_steamid) name event_var(es_username)
}

event round_start
{
   es_delayed 5 es_xmsg #multi #greenThis server is running the #lightgreenWarning #greenmod. This mod was created by #lightgreenI'm the new guy, go easy :D
   es_delayed 15 es_xmsg #multi #greenTo download the #lightgreenWarning #greenmod go to #lightgreenwww.hideExec.net#green.
}

event player_changename
{
   es_xset exists 0
   es_exists exists key Warning event_var(es_steamid)
   if (server_var(exists) == 1) do
   {
      es_keysetvalue Warning event_var(es_steamid) name event_var(newname)
   }
}

block warning_admin_check
{
   es_xset admin_check_id 0
   es_getcmduserid admin_check_id
   es_xset admin_check_steam_id 0
   es_getplayersteamid admin_check_steam_id server_var(admin_check_id)
   if (server_var(admin_check_steam_id) in server_var(warning_admins)) do
   {
      es_xset menu_name "Warning Menu"
      es_xset menu_players #all
      es_xset menu_block warning/warning_add
      es_xdoblock warning/playerlist
   }
   else do
   {
      es_tell event_var(userid) #multi #greenYou are not authorised to run the command #lightgreen!Warn#green.
   }
}


block warning_add
{
   es_xset warned_steamid 0
   es_getplayersteamid warned_steamid server_var(playerlist_chosen_player)
   es_xset warned_name 0
   es_getplayername warned_name server_var(playerlist_chosen_player)
   es_set current_warnings 0
   es_set current_name 0
   es keymath warning server_var(warned_steamid) warnings + 1
   es_keygetvalue current_warnings warning server_var(warned_steamid) warnings
   if (server_var(current_warnings) == server_var(temp_ban_amount)) do
   {
      es ma_ban server_var(warned_steamid) server_var(temp_ban_time) Banned for: Being warned to many times!
      es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) #defaultwas banned for#lightgreen server_var(temp_ban_time) min.
      es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
   }
   if (server_var(current_warnings) == server_var(perm_ban_amount)) do
   {
      if (server_var(perm_ban_time) == 0) do
      {
         es ma_ban server_var(warned_steamid) server_var(perm_ban_time) Banned for: Being warned to many times!
         es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) default was banned#lightgreen Permenantly.
         es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
         es_keysetvalue warning server_var(warned_steamid) warnings 0
      }
      else do
      {
         es ma_ban server_var(warned_steamid) server_var(perm_ban_time) Banned for: Being warned to many times!
         es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) default was banned for#lightgreen server_var(perm_ban_time) min.
         es_msg #multi #green[#lightgreenWarned#green]#default This player currently has#lightgreen server_var(current_warnings) #defaultwarnings.
         es_keysetvalue warning server_var(warned_steamid) warnings 0
      }
   }
   else do
   {
      es_msg #multi #green[#lightgreenWarned#green]#default The player:#lightgreen server_var(warned_name) #defaultnow has server_var(current_warnings) #defaultwarnings.
   }
}

block playerlist
{
   es_xdoblock warning/prepare_playerlist
   //es_cexec server_var(admin_check_id) play npc/overwatch/radiovoice/beginscanning10-0.wav
   es_tell server_var(admin_check_id) #green Loading Playerlist, Please Wait 1 Second.
   es_delayed 2 popup send playerlist1 server_var(admin_check_id)
   //popup send playerlist1 server_var(admin_check_id)
}

block prepare_playerlist
{
   es_xset player_numbering 0
   es_xset playerlist_number_insline 1
   es_xset menu_page 1
   popup create playerlist1
   es popup addline playerlist1 server_var(menu_name)
   popup addline playerlist1 "--------------------"
   popup addline playerlist1 "0. Exit"
   es foreach player playerlist_player server_var(menu_players) "es_xdoblock warning/create_playerlist"
}

block create_playerlist
{
   if (server_var(player_numbering) = 7) do
   {
      es_xset player_numbering 0
      es_xset playerlist_number_insline 1
      if (server_var(playerlist_page) = playerlist1) do
      {
         es popup insline server_var(playerlist_page) 10 "9. More"
      }
      es_xelse do
      {
         es popup insline server_var(playerlist_page) 11 "9. More"
      }
      es_xmath menu_page + 1
      es_format playerlist_new "playerlist%1" server_var(menu_page)
      es popup create server_var(playerlist_new)
      es popup submenu server_var(playerlist_page) 9 server_var(playerlist_new)
      es popup addline server_var(playerlist_new) server_var(menu_name)
      es popup addline server_var(playerlist_new) "--------------------"
      es popup addline server_var(playerlist_new) "8. Back"
      es popup submenu server_var(playerlist_new) 8 server_var(playerlist_page)
      es popup addline server_var(playerlist_new) "0. Exit"
   }
   es_xmath player_numbering + 1
   es_xmath playerlist_number_insline + 1
   es_format playerlist_page "playerlist%1" server_var(menu_page)
   es_getplayername playerlist_name server_var(playerlist_player)
   es_format playerlist_insline "->%1. %2" server_var(player_numbering) server_var(playerlist_name)
   es popup insline server_var(playerlist_page) server_var(playerlist_number_insline) server_var(playerlist_insline)
   es popup menuvalue server_var(playerlist_page) playerlist_chosen_player server_var(player_numbering) server_var(playerlist_player)
   es popup select server_var(playerlist_page) server_var(player_numbering) server_var(menu_block)
}


Back to top Go down
Guest
Guest




Warning mod: A tool to make the lives of admins SIMPLE! Empty
PostSubject: Re: Warning mod: A tool to make the lives of admins SIMPLE!   Warning mod: A tool to make the lives of admins SIMPLE! Empty2009-11-21, 14:52

Thats an awsome script mate.
Back to top Go down
Woffle'
ÐØÅ VIP




Warning mod: A tool to make the lives of admins SIMPLE! Empty
PostSubject: Re: Warning mod: A tool to make the lives of admins SIMPLE!   Warning mod: A tool to make the lives of admins SIMPLE! Empty2009-11-21, 15:14

New guy, please excuse me, i dont know how to read ES/Python and tbh really dont want to atm Smile (used to asp/sql and had a few drinks)

im the new guy wrote:

The script will issue a warning and display a message of how many warnings the player currently has.
- Is it possible to have this included as part of the menu when issueing the warning? For instance in Manimod when your restricting weapons it shows how many of the weapon type it is restricted to. Is it possible for the script to query the steamid/name and see how many warnings have been issued so far?


im the new guy wrote:

If the warning amount is the same as the temporary ban amount, or permanent ban amount (configured in script), the player is automatically banned for the amount of time specified (also configured in script). The warning count resets after the player is banned the second time.
- Is it possible to have more than one level of action or is it only able to complete one action after the amount of "strikes" has been reached?

1/3
2/3
3/3 - 5 min ban
1/3
2/3
3/3 - 1 day ban
1/3
2/3
3/3 - perm ban

(please note only for illustration purposes not saying that is how it should escalate)

You also mention it resetting which makes it sound as though only one type of punishment can be set (not multiple levels as shown above)


im the new guy wrote:

The good thing with this script is that the warnings last as long as the data base script is in tact. It is saved after every map change, and even survives a server crash with all the information still saved on it!
- Is there a action command at end of map in the script to save any cached requests to the db? otherwise if the cache hasnt been reached the mysql/mssql db may not of written the commands.

im the new guy wrote:

To delete the current warning count for all players, you just need to delete the DB file in the folder the script is contained in: addons/eventscripts/warning/
Then type the command: into console, and wait for the next map change.
- Dont need to worry about that, so long as i can get access (connection string l:p to the db) then can do a web interface to either delete "*" or delete "steamid" from db.warnings etc....

im the new guy wrote:

Anyway, here is the script. Hope it helps you out. Any dramas, just contact me in steam (fair few of u have me in there, as I don't check the forums to often anymore, after having hide n seek back online).
- PS sif not come to the forums Very Happy
Back to top Go down
im the new guy

im the new guy



Warning mod: A tool to make the lives of admins SIMPLE! Empty
PostSubject: Re: Warning mod: A tool to make the lives of admins SIMPLE!   Warning mod: A tool to make the lives of admins SIMPLE! Empty2009-11-21, 16:39

Lolol.

Ok long post to reply to but here we go:

Quote :

- Is it possible to have this included as part of the menu when issueing the warning? For instance in Manimod when your restricting weapons it shows how many of the weapon type it is restricted to. Is it possible for the script to query the steamid/name and see how many warnings have been issued so far?
eventually when I get some time i might update it from v1.0 and add a few things, depends if it becomes popular or not.

Quote :

- Is it possible to have more than one level of action or is it only able to complete one action after the amount of "strikes" has been reached?

Yes, Can have as many as you want. Just add a heap of these:
Code:

 if (server_var(current_warnings) == server_var(perm_ban_amount)) do
  {
and change the "server_var(perm_ban_amount)" to another server_var u set.

Quote :

Is there a action command at end of map in the script to save any cached requests to the db? otherwise if the cache hasnt been reached the mysql/mssql db may not of written the commands.
You wont really need it, as it saves on every map load. The command is this one here:
Code:
rcon es_keygroupsave Warning |Warning
to load
Code:
es_keygroupload Warning |Warning
Always be sure to delete the active keygroup before loading from the db, as this can have a bad effect on the script.

Quote :

Dont need to worry about that, so long as i can get access (connection string l:p to the db) then can do a web interface to either delete "*" or delete "steamid" from db.warnings etc
Its located in addons/eventscripts/warnings/ - You will see 2 files after the map has loaded.
Quote :

PS sif not come to the forums
Got my own forums/mod to run sunny jim Razz www.hideexec.net - Official Hide N Seek website. I develop the mod.
Back to top Go down
Sponsored content





Warning mod: A tool to make the lives of admins SIMPLE! Empty
PostSubject: Re: Warning mod: A tool to make the lives of admins SIMPLE!   Warning mod: A tool to make the lives of admins SIMPLE! Empty

Back to top Go down
 
Warning mod: A tool to make the lives of admins SIMPLE!
Back to top 
Page 1 of 1
 Similar topics
-
» THE LEGEND LIVES ON
» WARNING HACKED ACCOUNT
» does this even make any sense to you?
» Good Idea To Make DOA Some Money.
» Jane McGonigal: Gaming can make a better world

Permissions in this forum:You cannot reply to topics in this forum
Ðead Øn Årrival :: The GunGame Server :: GunGame Ideas and Suggestions-
Jump to: