Raised This Month: $32 Target: $400
 8% 

Superhero VIP!


Post New Thread Reply   
 
Thread Tools Display Modes
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-15-2011 , 17:43   Re: Superhero VIP!
Reply With Quote #11

Look leets post this as request so that someone can finish this for us, and see what people have posted after like 1 week....

Who knows, maybe it will come out as an brilliant idea, i know this idea sounds good but i like ideas about new heroes,powers more...
thats my thing
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-15-2011 , 19:08   Re: Superhero VIP!
Reply With Quote #12

Quote:
Originally Posted by RollerBlades View Post
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....)
Not sure what you mean by "10 - 17 lagg" btw, "lagg" is spelled "lag", not "lagg". Only one g.

Also, this very small plugin should not affect performance on the server so much that you will notice it. That was not what I was asking you to test.
I was simply asking you to test if it WORKS, and judging from your post it does work.
First get the plugin working and do the right thing, then optimize what optimized can.

Quote:
Originally Posted by DarkGod View Post
No sense in returning as you do that after the switch, anyway.
I am just unsure about the returning value. PLUGIN_HANDLED stops the plugin sending any more information to the server if I have understood it right.
Also, when the switch case is 1 as an example, the code should stop there with or without a return, right?
I just made those returns as the guy who made the plugin I was looking at did it, but I am really not sure why he did that.

Quote:
Originally Posted by RollerBlades View Post
Look leets post this as request so that someone can finish this for us, and see what people have posted after like 1 week....

Who knows, maybe it will come out as an brilliant idea, i know this idea sounds good but i like ideas about new heroes,powers more...
thats my thing
Not sure what you mean, but why wait a week? I am perfectly capable of getting this to run as intended, it just needs testing.
Once I get time I will start working on actually make it do something.
__________________
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-16-2011 , 02:11   Re: Superhero VIP!
Reply With Quote #13

Quote:
Originally Posted by Jelle View Post
I am just unsure about the returning value. PLUGIN_HANDLED stops the plugin sending any more information to the server if I have understood it right.
Also, when the switch case is 1 as an example, the code should stop there with or without a return, right?
I just made those returns as the guy who made the plugin I was looking at did it, but I am really not sure why he did that.
I think it's supposed to be in conjunction with a menu_destroy so returning PLUGIN_HANDLED in the end of the function is fine.
__________________
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-16-2011 , 03:03   Re: Superhero VIP!
Reply With Quote #14

Quote:
Originally Posted by DarkGod View Post
I think it's supposed to be in conjunction with a menu_destroy so returning PLUGIN_HANDLED in the end of the function is fine.
Oh. I will do that when I start putting the powers in it.
__________________
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-16-2011 , 03:47   Re: Superhero VIP!
Reply With Quote #15

So your making powers to it now?

Wow, first time someone really listen to my idea's... even though they suck....
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-16-2011 , 04:03   Re: Superhero VIP!
Reply With Quote #16

DarkGod, do you know a way to get people to actually heal the health they have just bought? If I just add 5 HP to a player he wont be able to heal it again which sucks a bit.

I have made most of it, just the healing for the HP which I don't get, also the life drain hasn't been made just yet.

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

#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

new gHasSpeed[SH_MAXSLOTS+1]
new 
Float:gUserSpeed[SH_MAXSLOTS+1]

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

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)
            
sh_set_user_xp(id, -5true)
            
set_user_health(idget_user_health(id) + 5)
            
client_print(idprint_chat"[SH] Bought 5 HP for 5 XP")
        }
        
        
//if they press 2 (buy AP)
        
case 2:
        {
            
menu_destroy(menu)
            
set_user_armor(idget_user_armor(id) + 10)
            
sh_set_user_xp(id, -5true)
            
client_print(idprint_chat"[SH] Bought 10 AP for 5 XP")
        }
        
        
//if they press 3 (buy speed)
        
case 3:
        {
            
menu_destroy(menu)
            
gUserSpeed[id] = get_user_maxspeed(id) +10.0
            set_user_maxspeed
(idgUserSpeed[id])
            
sh_set_user_xp(id, -5true)
            
client_print(idprint_chat"[SH] Bought +10 speed for 5 XP")
            
gHasSpeed[id] = true
        
}
        
        
//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 
FwdPlayerResetMaxSpeedPost(id)
{
    if ( 
gHasSpeed[id] )
    {
        
set_user_maxspeed(idgUserSpeed[id])
    }
}

public 
sh_client_spawn(id)
{
    
gHasSpeed[id] = false
}

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

EDIT: Updated code. Now it constantly should check if the client has the actual running speed he has bought. Not sure if it works, didn't test it.
__________________
No idea what to write here...

Last edited by Jelle; 03-16-2011 at 04:30.
Jelle is offline
Send a message via MSN to Jelle
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-16-2011 , 04:54   Re: Superhero VIP!
Reply With Quote #17

Quote:
Originally Posted by Jelle View Post
DarkGod, do you know a way to get people to actually heal the health they have just bought?
What? You mean that they choose how much XP to use?
__________________
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-16-2011 , 04:57   Re: Superhero VIP!
Reply With Quote #18

No.

If a user chooses to get 50HP more. Lets say he has 150 HP (superman default), then he buys 50 more. Now he has 200.

If he get shot at so he has like 130. He will only heal to 150 HP (assuming he has wolverine or another healing hero) not to the original 200 HP which he has actually bought. Then it will be kind of pointless to buy health. Also the vampiric drain will only work untill 150 HP.
__________________
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-16-2011 , 05:23   Re: Superhero VIP!
Reply With Quote #19

I don't think there's any direct way to set max health right now. That may be a good native suggestion for future revisions.

It's stored in the gMaxHealth variable in the core, so you could make your own native for that easily.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 03-16-2011 , 05:27   Re: Superhero VIP!
Reply With Quote #20

And a health reset native lol. I were sure there was one already, but oh I were so wrong.
__________________
The Art of War is offline
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 05:43.


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