Raised This Month: $51 Target: $400
 12% 

Superhero VIP!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
olari9
Senior Member
Join Date: May 2009
Old 03-15-2011 , 12:59   Superhero VIP!
Reply With Quote #1

Ok, i quess that there should be a superhero vip! Can somebody please do me that?
Some things that i already made!
shv_add_kill_xp(id, victim, Float:multiplier = 2.0);
That means if you want to make something as vip item just change the sh_... to shv_...
Thanks!
__________________
olari9 is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2011 , 13:40   Re: Superhero VIP!
Reply With Quote #2

Quote:
Originally Posted by olari9 View Post
Some things that i already made!
shv_add_kill_xp(id, victim, Float:multiplier = 2.0);
Thanks!
Care to post the include file and the plugin for that native?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-15-2011 , 13:51   Re: Superhero VIP!
Reply With Quote #3

I got an idea for an good plugin that everyone can use

pay exp to buy hp and ap and speed and drain(how much drain per bullet) and cloak
xp per hp = 5

xp per ap = 2 (nice with goku )

xp per speed = 30

xp per drain = 500

xp per cloak(%) = 700

that's just an idea not a request so if your asking for an VIP plugin why not just put in a plugin everyone can use?
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2011 , 14:26   Re: Superhero VIP!
Reply With Quote #4

Quote:
Originally Posted by RollerBlades View Post
I got an idea for an good plugin that everyone can use

pay exp to buy hp and ap and speed and drain(how much drain per bullet) and cloak
xp per hp = 5

xp per ap = 2 (nice with goku )

xp per speed = 30

xp per drain = 500

xp per cloak(%) = 700

that's just an idea not a request so if your asking for an VIP plugin why not just put in a plugin everyone can use?
If I can get a menu working for it it would be a nice idea. Might start to look at this, but do not expect me to be done. Might post what I have done in here so others can finish it as I really don't think I have time to do the whole thing.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-15-2011 , 15:09   Re: Superhero VIP!
Reply With Quote #5

maybe you shoud do the cloak thingy last cause im thinking if you shoud put a max limit on it so you dont become 100% invisble cause it woud be unfair, so well have to wait with that
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2011 , 16:28   Re: Superhero VIP!
Reply With Quote #6

PHP Code:
#include <superheromod>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("Buy stuff with XP""1.0 Beta""Jelle")
    
    
register_clcmd("say /buy""cmd_menu"0"- Displays the menu to buy stuff for your XP")
}

public 
cmd_menu(idlvlcid)
{
    
//create the first menu
    
new menu menu_create("Buy stuff with XP""menu_handler")
    
menu_additem(menu"/yBuy HP""1"0)
    
menu_additem(menu"/yBuy AP""2"0)
    
menu_additem(menu"/yBuy speed""3"0)
    
menu_additem(menu"/yBuy Vampiric drain""4"0)
    
menu_addblank(menu)
    
menu_addblank(menu)
    
menu_addblank(menu)
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
    
//show the menu to the client
    
menu_display(idmenu0)
}

public 
menu_handler(idmenuitem)
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    
//Get info of what was pressed on previous menu
    
new cmd[6], Name[64], accescallbackkey
    menu_item_getinfo
(menuitemaccescmd5Name63callback)
    
    
//Make the number, which is a string (The number pressed on the first menu) into a number so we can check what the client pressed
    
key str_to_num(cmd)
    
    
//Make a switch to check what number client pressed in the first menu
    
switch(key)
    {
        
//If they press 1 (buy HP)
        
case 1:
        {
            
menu_destroy(menu)
            
set_task(0.1"buy_hp"id)
            return 
PLUGIN_HANDLED
        
}
        
        
//if they press 2 (buy AP)
        
case 2:
        {
            
menu_destroy(menu)
            
set_task(0.1"buy_ap"id)
            return 
PLUGIN_HANDLED
        
}
        
        
//if they press 3 (buy speed)
        
case 3:
        {
            
menu_destroy(menu)
            
set_task(0.1"buy_speed"id)
            return 
PLUGIN_HANDLED
        
}
        
        
//if they press 4 (Buy vampiric drain)
        
case 4:
        {
            
menu_destroy(menu)
            
set_task(0.1"buy_drain"id)
            return 
PLUGIN_HANDLED
        
}
    }
    
    
//destroy the menu just for the sake of doing it
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

public 
buy_hp(id)
{
    
client_print(idprint_chat"[SH-Debug] Buy HP pressed")
}

public 
buy_ap(id)
{
    
client_print(idprint_chat"[SH-Debug] Buy AP pressed")
}

public 
buy_speed(id)
{
    
client_print(idprint_chat"[SH-Debug] Buy speed pressed")
}

public 
buy_drain(id)
{
    
client_print(idprint_chat"[SH-Debug] Buy Vampiric drain pressed")

Compile and test it. I have not done the actual thing yet. When it shows the menu and you press a number it should print in the chat what you have pressed. If it does that then yay. Then it is almost done, only the powers is to be made.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-15-2011 , 16:37   Re: Superhero VIP!
Reply With Quote #7

set_task(0.1, "buy_drain", id) etc

Why task?
I also suggest just making a single function for the giving with a switch in it.

EDIT: Or do it directly.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2011 , 16:44   Re: Superhero VIP!
Reply With Quote #8

I used the task as the code I have been learning this from was doing it. I thought it might be because it had to wait a bit before going to the function.

Doing it directly might be the best way to go, as the code needed really isn't that long.

I should also make a speed check once in a while. It might go back to default sometimes for different reasons. I have a ham method of doing that.

But I really want someone to test this before I do anything further, as I have not done a fully working menu before.

EDIT:
Also not sure if I am returning the right way. Or can I skip the return totally. In my mind the plugin will stop once the switch goes to one of the cases and does what is in that case, but not entirely sure about this.
__________________
No idea what to write here...

Last edited by Jelle; 03-15-2011 at 16:51.
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-15-2011 , 16:59   Re: Superhero VIP!
Reply With Quote #9

The script is fine but im not sure about when i use the plugin it's a normal menu but it kinda affects my lathenchy it goes from 5-10 never higher! to like 13-14.... im not sure so i will test i couple of times with and without both lan and internet so dont start with anything, this is just so you know that i tested it and that it works fine.. also it when i say /buy it kinda bugg's abit

EDIT:

So, i tested it on my server(internet) and well here how it went:

Most of time 4-10lagg and 8% of time it went randomly from 10-15 Without plugin

Most of time 10-17lagg and 25%(in the beginning) it was around 4-9lagg when i used the /buy action a frew times then it went up with plugin

That's all i can tell you from now on..... Try changing it so that you dont have to say /buy in say instead you use key, i want to test that too... ore both.. (i woud guess there's something wrong when selecting something in the menu....)

Last edited by RollerBlades; 03-15-2011 at 17:17.
RollerBlades is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-15-2011 , 17:20   Re: Superhero VIP!
Reply With Quote #10

No sense in returning as you do that after the switch, anyway.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Reply



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:18.


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