Raised This Month: $66 Target: $400
 16% 

Buying Personal Gravity (Command and Menu! =))


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   v3x (159)
Jordan
Veteran Member
Join Date: Aug 2005
Old 02-17-2006 , 17:28   Buying Personal Gravity (Command and Menu! =))
Reply With Quote #1

Description
This plugin allows players to buy their own gravity, or an admin can give personal gravity to them. Gravity lasts until the person dies.

Version
1.5

Commands
amx_pgrav - Admin command which sets personal gravity to a player.
say /buygrav - Brings up gravity menu.

Note - to give gravity, you should do amx_pgrav <nick> 400 (or your number ) - You don't need to do amx_pgrav <nick> 0.5.

Modules Required
Fun
Cstrike

Errors
None known.

Tested
Yes, WIN32 server.

Coming
I don't know, give me ideas

Installation Instructions
Choose get plugin from the options below, and place into addons/amxmodx/plugins folder. Put personalgravity.amxx in the last line of your plugins.ini.

You can also choose download from the options below and manually compile. Place into addons/amxmodx/plugins folder. Put personalgravity.amxx in the last line of your plugins.ini.


Credits
v3x for some coding help which I figured out worked 3 months later.

Note - I know this has been made before, but the menu with the buying gravity is a new option - the personal gravity is a nice little extra function, which can be removed if wanted
Attached Files
File Type: sma Get Plugin or Get Source (personalgravity.sma - 4198 views - 4.8 KB)
Jordan is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-18-2006 , 21:27  
Reply With Quote #2

Suggestion: Make it last until they die.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 02-18-2006 , 22:29  
Reply With Quote #3

It does last until the person dies and ty for approving ^^
Jordan is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-19-2006 , 01:44  
Reply With Quote #4

Oh, I see now. Someone else told me how good it worked and that it didn't last through rounds. I guess he was wrong then ;]
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 02-19-2006 , 13:40  
Reply With Quote #5

It works for me ^^
Jordan is offline
Petey B
Member
Join Date: Feb 2005
Old 02-19-2006 , 22:45  
Reply With Quote #6

i hope u dont mind but im gunna port this to amx

(not i direct port - i re-wrote it)
Petey B is offline
Send a message via MSN to Petey B
Jordan
Veteran Member
Join Date: Aug 2005
Old 02-19-2006 , 23:08  
Reply With Quote #7

Sure.
Jordan is offline
LinkaN
Junior Member
Join Date: Apr 2006
Old 04-08-2006 , 20:06  
Reply With Quote #8

Sorry to gravedigg but can someone edit this so that you only can buy gravity after like 5 kills?
LinkaN is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 04-08-2006 , 20:32  
Reply With Quote #9

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> /*Description: 1) Adds a gravity command which gives an individual player a specific amount of gravity which remains until player's death, in which case it is set back to normal (800). 2) Allows the players to buy their own gravities. Credits: v3x for some coding help which I figured out worked 3 months later. :)                     Changelog                   1.0 - Original Coding                   1.1 - Added Description/Credits/Changelog                   1.2 - Coding fixing.                   1.3 - Coding fixing.                   1.4 - Coding fixing.                   1.5 - Coding fixing - hopefully release version.*/ new g_Nick[32] new g_Number[10] new Float:g_fGravity[33]; new g_Keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_0 public plugin_init() {     register_plugin("Personal Gravity", "1.5", "SatanWoJ")     register_concmd("amx_pgrav", "gravity", ADMIN_KICK, "<nick> <gravity>")     register_clcmd("say /buygrav", "bgrav", 0)     register_menucmd(register_menuid("Gravity Menu"), g_Keys, "GravMenu")     register_event("ResetHUD", "player_spawn", "b");      register_event("DeathMsg", "hook_death", "a") } //----------------------------------------------------------------------------- public gravity(id, level, cid) {     if(!cmd_access(id, level, cid, 2))     {         return PLUGIN_HANDLED;     }     read_argv(1, g_Nick, 31)     read_argv(2, g_Number, 9)     new target = cmd_target(id, g_Nick, 15)     new Float:f_Amount = str_to_float(g_Number)/800     set_user_gravity(target, f_Amount)     g_fGravity[id] = f_Amount     return PLUGIN_CONTINUE } //-----------------------------------------------------------------------------  public bgrav(id) {     if(!is_user_alive(id))     {         return PLUGIN_HANDLED;     }         new menu[192]     new frags = get_user_frags(id)         if(frags < 5)     {         client_print(id, print_chat, "You do not have enough kills!")         return PLUGIN_HANDLED;     }         format(menu, 191, "Gravity Menu^n^n1. 100 - $5000^n2. 200 - $3500^n3. 400 - $2000^n4. 550 - $1500^n5. 800 - $0^n^n0. BACK.")     show_menu(id, g_Keys, menu)     return PLUGIN_HANDLED } //----------------------------------------------------------------------------- public hook_death() {     new Victim = read_data(2)     g_fGravity[Victim] = 1.0     return PLUGIN_CONTINUE }  //----------------------------------------------------------------------------- public GravMenu(id, key) {     switch(key)     {         case 0:         {             new money = cs_get_user_money(id)             new Float:grav = get_user_gravity(id)             if(money <= 4999)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.125)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 }                 else                 {                     cs_set_user_money(id, money-5000)                     set_user_gravity(id, 0.125)                     return PLUGIN_HANDLED                 }         }         case 1:         {             new money = cs_get_user_money(id)             new Float:grav = get_user_gravity(id)             if(money <= 3499)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.25)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 }                 else                 {                     cs_set_user_money(id, money-3500)                     set_user_gravity(id, 0.25)                     return PLUGIN_HANDLED                 }         }         case 2:         {             new money = cs_get_user_money(id)             new Float:grav = get_user_gravity(id)             if(money <= 1999)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.5)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 }                 else                 {                     cs_set_user_money(id, money-2000)                     set_user_gravity(id, 0.5)                     return PLUGIN_HANDLED                 }         }         case 3:         {             new money = cs_get_user_money(id)             new Float:grav = get_user_gravity(id)             if(money <= 1499)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.6875)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 }                 else                 {                     cs_set_user_money(id, money-1500)                     set_user_gravity(id, 0.6875)                     return PLUGIN_HANDLED                 }         }         case 4:         {             new Float:grav = get_user_gravity(id)             if(grav == 1.0)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 }                 else                 {                     set_user_gravity(id, 1.0)                     return PLUGIN_HANDLED                 }         }         case 9:         {             return PLUGIN_HANDLED;         }     }     return PLUGIN_HANDLED } //----------------------------------------------------------------------------- public client_connect(id) {     g_fGravity[id] = 1.0 } //----------------------------------------------------------------------------- public player_spawn(id) {     set_user_gravity(id, g_fGravity[id])     return PLUGIN_CONTINUE }
Jordan is offline
bigman11
Member
Join Date: Jun 2006
Location: Computer
Old 06-06-2006 , 20:16   great
Reply With Quote #10

Best thing i ever. got
__________________
bigman11 is offline
Send a message via MSN to bigman11
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 01:37.


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