AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Buying Personal Gravity (Command and Menu! =)) (https://forums.alliedmods.net/showthread.php?t=24292)

Jordan 02-17-2006 16:28

Buying Personal Gravity (Command and Menu! =))
 
1 Attachment(s)
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 :P) - 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 :)

v3x 02-18-2006 20:27

Suggestion: Make it last until they die.

Jordan 02-18-2006 21:29

It does last until the person dies :P and ty for approving ^^

v3x 02-19-2006 00:44

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 ;]

Jordan 02-19-2006 12:40

It works for me :P ^^

Petey B 02-19-2006 21:45

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

(not i direct port - i re-wrote it)

Jordan 02-19-2006 22:08

Sure.

LinkaN 04-08-2006 19:06

Sorry to gravedigg but can someone edit this so that you only can buy gravity after like 5 kills?

Jordan 04-08-2006 19:32

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 }

bigman11 06-06-2006 19:16

great
 
Best thing i ever. got


All times are GMT -4. The time now is 03:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.