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

Grenade Request


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   Exolent[jNr] (178)
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 12-01-2009 , 23:28   Grenade Request
Reply With Quote #1

Grenade Request is a plugin that allow players to request a grenade in game without paying. Simply type /nade and a menu will appear say choose your grenade.




----------------
CREDITS
----------------


Emp` :For his new menu.
Shadow_Wave :Testing
shadow.hk : For fixing up the code Thanks Alot


----------------------------
Coded By Shuttle_Wave
----------------------------


Shuttle_Wave

PHP Code:
/* 
    
    .:: Credits ::.
    
    shadow.hk for help me with fixing this code :D
    
*/

#pragma semicolon 1

#include <amxmodx>
#include <fun>

new const VERSION[] = "2.0";
new const 
PREFIX[] = "!g[GR]!n";

new const 
g_szGrenade[3][] =
{
    
"HE Grenade",
    
"Flashbang",
    
"Smoke Grenade"
};

// Plugins Stuff
public plugin_init()
{
    
register_plugin("Grenade Request"VERSION"Shuttle_Wave");
    
    
register_clcmd("say /nade",        "NadeMenu");
    
register_clcmd("say_team /nade",    "NadeMenu");
    
    
set_task(180.0"taskAdvertise"___"b");
}

public 
NadeMenu(id)
{
    new 
menu menu_create("\rChoose Your Grenade!""NadeMenu_Handler");
    
    
menu_additem(menu"\wHE Grenade",        "1"0);
    
menu_additem(menu"\wFlash Bang",        "2"0);
    
menu_additem(menu"\wSmoke Grenade",    "3"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
}

public 
NadeMenu_Handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch( 
key )
    {
        case 
1give_item(id"weapon_hegrenade");
        case 
2give_item(id"weapon_flashbang");
        case 
3give_item(id"weapon_smokegrenade");
    }
    
    
client_printc(id"%s You now have a !g%s!n"PREFIXg_szGrenade[key-1]);
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
taskAdvertise()
{
    
client_printc(LANG_SERVER"%s Type !g/nade!n to open up the grenade request menu."PREFIX);
}

// Thanks to alka (his code)
client_printc(index, const text[], any:...)
{
    new 
szMsg[128];
    
vformat(szMsgsizeof(szMsg) - 1text3);
    
    
replace_all(szMsgsizeof(szMsg) - 1"!g""^x04");
    
replace_all(szMsgsizeof(szMsg) - 1"!n""^x01");
    
replace_all(szMsgsizeof(szMsg) - 1"!t""^x03");
    
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _index);
    
write_byte(index);
    
write_string(szMsg);
    
message_end();

Attached Files
File Type: sma Get Plugin or Get Source (grenaderequest2.sma - 1407 views - 2.4 KB)

Last edited by shuttle_wave; 12-21-2009 at 09:23.
shuttle_wave is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 12-01-2009 , 23:36   Re: Grenade Request
Reply With Quote #2

simple plugin but you made it nice ^_^ +karma
__________________
Zombiezzz is offline
A.B.
Member
Join Date: Nov 2009
Old 12-01-2009 , 23:44   Re: Grenade Request
Reply With Quote #3

Copyrights 2009, Shuttle_Wave
A.B. is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 12-02-2009 , 00:02   Re: Grenade Request
Reply With Quote #4

Thanks
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 12-02-2009 , 01:13   Re: Grenade Request
Reply With Quote #5

make it so (with a cvar) we can have a price for each $$$
__________________
mando127 is offline
Send a message via Skype™ to mando127
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 12-02-2009 , 01:41   Re: Grenade Request
Reply With Quote #6

Quote:
Originally Posted by A.B. View Post
Copyrights 2009, Shuttle_Wave

Quote:
Originally Posted by mando127 View Post
make it so (with a cvar) we can have a price for each $$$
maybe 2hard?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 12-02-2009 , 02:38   Re: Grenade Request
Reply With Quote #7

i can do it. I made his to test Emp` menu so it came out good. Ill work on it l8ter on. Just working of a full jailbreak. Im really sucking for a 14 years old boy lol
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 12-02-2009 , 08:22   Re: Grenade Request
Reply With Quote #8

-You must try something like:
PHP Code:
/* 
    
    ------------------------------
    Copyrights 2009 , Shuttle_Wave
    ------------------------------
    
    Grenade Request Menu coded by Shuttle_Wave. Waves Extreme Gaming Network.
    Bugs or issues contact Shuttle_Wave. [email protected] or via PM.
    
    
    
    --------
    CREDITS
    --------
    
    Emp` ; For his new AMXX Menu System.
    Shadow_Wave ; Testing
    
    
    ---------
    Contacts
    ---------
    
    Shuttle_Wave ; [email protected] or via PM

*/


// Includes
#include <amxmodx>
#include <fun>
#include <hamsandwich>

// Defines
#define USE_COLORCHAT

#if defined USE_COLORCHAT
#include <colorchat>
#endif
#define VERSION "2.0"


// Plugins Stuff
public plugin_init() {
    
register_plugin("Grenade Request"VERSION"Shuttle_Wave")
    
    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)
    
    
register_clcmd"say /nade","NadeMenu");
    
register_clcmd"say_team /nade","NadeMenu");
}

public 
NadeMenu(id)
{
    new 
menu menu_create("\rChoose Your Grenade!""menu_handler");
    
    
menu_additem(menu"\wHE Grenade""1"0);
    
menu_additem(menu"\wFlash Bang""2"0);
    
menu_additem(menu"\wSmoke Grenade""3"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);    
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;    
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a ^x04HE Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a HE Grenade");
            
give_itemid"weapon_hegrenade" );
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED
        
}
        case 
2:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a^x04 Flash Bang Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a Flash Bang Grenade");
            
give_itemid"weapon_flashbang" );
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED
        
}
        case 
3:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a ^x04Smoke Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a Smoke Grenade");
            
give_itemid"weapon_smokegrenade" );
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED
        
}
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED
}

public 
Player_Spawn_Post(id)
{
    
#if defined USE_COLORCHAT
    
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] To request a grenade type ^x04/nade^x01");
    
#endif
    
client_print(idprint_chat"[ Grenade Request ] To request a grenade type /nade");
    return 
PLUGIN_HANDLED
}
/* Shuttle_Waves-Nots - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
For who don't see, i added the part with #if defined USE_COLORCHAT.
If you don't want to use COLORCHAT, add // before #define USE_COLORCHAT.
Is easier than your method.

-At the menu, is useless to destroy every case, destroy when the plugin is end:
PHP Code:
    switch(key)
    {
        case 
1:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a ^x04HE Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a HE Grenade");
            
give_itemid"weapon_hegrenade" );
    }
        case 
2:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a^x04 Flash Bang Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a Flash Bang Grenade");
            
give_itemid"weapon_flashbang" );
    }
        case 
3:
        {
            
#if defined USE_COLORCHAT
            
ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You now have a ^x04Smoke Grenade^x01");
            
#endif
            
client_print(idprint_chat"[ Grenade Request ] You now have a Smoke Grenade");
            
give_itemid"weapon_smokegrenade" );
    }
}
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED

__________________


Last edited by floatman; 12-02-2009 at 08:27.
floatman is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 12-02-2009 , 10:24   Re: Grenade Request
Reply With Quote #9

make a cvar to use it X times per round.. i can spam server with nades with this plugin
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx

tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 12-02-2009 , 10:27   Re: Grenade Request
Reply With Quote #10

Quote:
Originally Posted by tuty View Post
make a cvar to use it X times per round.. i can spam server with nades with this plugin
yes.

Like it is so far, its just another useless plugin.
(My opinion)

I mean, what if evryone makes a menu for every weapon?
It just has no point.
__________________
I am out of order!
grimvh2 is offline
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 11:46.


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