Raised This Month: $100 Target: $400
 25% 

Random Number/Player + Command


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   v3x (159)
Des12
Senior Member
Join Date: Jan 2005
Old 03-03-2006 , 21:18   Random Number/Player + Command
Reply With Quote #1

Plugin:
Random Number/Player + Command

Games/Mods:
Tested and working on The Specialists, but also should work for any half-life based game.

Extra Modules Required:
None

Purpose:
This plugin was created so that admins could generate random numbers with messages and commands attached. It just fills a gap in certain situations in which you randomly need to choose someone without bias suspected. (Such as who to kick for your friend to get in, but be moral and ignore your friend! Just to amx_randomplayer public "Random player to be kicked for friend to get in:" "amx_kick")

Commands:
amx_randomnumber <public, private, player, admins> <min> <max> [statement] [command]
The first part of the command is who the random number will print to:
Public means everyone.
Private means only yourself.
Player means it will print to you and a player.
Admins meants it will print to all admins.

Min is the minimum number for the random number.
Max is the maximum number for the random number.

Statement is what the plugin will display, such as "This is how much karma I have:"
Command is what the server will execute, such as "say"

amx_randomplayer <public, private, player, admins> [statement] [command]
The first part of the command is who the random number will print to:
Public means everyone.
Private means only yourself.
Player means it will print to you and a player.
Admins meants it will print to all admins.

Statement is what the plugin will display, such as "Here is the leetest player in the server:"
Command is what the server will execute, such as "amx_heal"

See examples of usage below.

Other:
1) When an admin enteres a random command, it says
[Random] ADMIN (name) initialized the Random Generator!
(or just "[Random] An admin initialized the Random Generator!" if you have amx show activity on a low level)

2) Including a command in the random requires a different admin level then having no command (since they could restart/shut down server). Defaults are:
With Command: Admin Rcon
Without Command: Admin Ban

3) Two cvars are included in the .cfg file:
If you want the admin who entered the command to be excluded from amx_randomplayer:
"random_selfimmune" "1"

If you want all the admins to be excluded from amx_randomplayer:
"random_adminsimmune" "1"

amx_randomnumber Examples

amx_randomnumber public 1 10 "The user choosen is:"
[Random] Public: The user chosen is: 3
(This prints to everyone since it is public)

amx_randomnumber private 5 6 "My IQ iz"
[Random] Private: My IQ iz 5
(This prints to only you since it is private)

amx_randomnumber dest 1 2 "You live = 1, You die = 2. Number:"
[Random] User-to-User: You live = 1, You die = 2. Number: 2
(This prints to Dest and you since you specified dest)

amx_randomnumber admins 1 10 "Lets make the server say" "say"
[Random] Admins: Lets make the server say 3
Dest's Server: 3
(This prints to all admins and makes the server say the random number)


amx_randomplayer Examples

amx_randomplayer public "I have chosen to be nice to:" "amx_heal"
[Random] Public: I have chosen to be nice to: Dest Romano
Dest's Server: Healed player Dest Romano

amx_randomplayer admins "This player is DOOMED:" "amx_slay"
[Random] This player is DOOMED: Dest Romano
Dest's Server: Slayed player Dest Romano

Credits:
Dest 'Des12' Romano - Coding the plugin
Attached Files
File Type: sma Get Plugin or Get Source (random.sma - 1427 views - 6.2 KB)
File Type: zip random.zip (12.9 KB, 223 views)
File Type: zip random.zip (12.1 KB, 147 views)
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
JKB
Member
Join Date: Jan 2006
Old 03-04-2006 , 09:59  
Reply With Quote #2

nice, really usefull and little complicated
__________________
Quote:
Chuck Norris doesn't sleep. He waits.
JKB is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-04-2006 , 10:57  
Reply With Quote #3

I just wanted a maximum amount of customization, so post if you have any suggestions and I will try to implement them!
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
JKB
Member
Join Date: Jan 2006
Old 03-04-2006 , 12:05  
Reply With Quote #4

Quote:
Originally Posted by Des12
I just wanted a maximum amount of customization
I like that
__________________
Quote:
Chuck Norris doesn't sleep. He waits.
JKB is offline
Des12
Senior Member
Join Date: Jan 2005
Old 03-04-2006 , 19:37  
Reply With Quote #5

I added a zip file for AMXX 1.70 just incase.
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 03-04-2006 , 22:10  
Reply With Quote #6

zomg, i needed this, thx
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:48.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode