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

Help with Setting HP,AP,Gravity,etc..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mirun.Frontier
Member
Join Date: Aug 2008
Old 03-07-2010 , 23:33   Help with Setting HP,AP,Gravity,etc..
Reply With Quote #1

I may have been here for a long time inactive, but I'm back, and I'm starting to script.
Anywho, I'm confused with doing a few simple things like:
After choosing a class, your HP, AP, and Gravity is set
After choosing a class, you get different weapons, and for each time you change a class, you get stripped of the weapons first, then given the weapons of the new class, to prevent bullshittery(that requires ham module, right?)

Can someone help me?
__________________
I can't believe I wasted 5 years of my life not knowing how to program correctly. Went too deep into advanced coding before even learning the basics correctly. :c
Mirun.Frontier is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-07-2010 , 23:45   Re: Help with Setting HP,AP,Gravity,etc..
Reply With Quote #2

To strip weapons (strip_user_weapons) and give weapons (give_item) you use <fun>.

Aside from that, what do you mean by 'class' and what else are you having issues with. Do you need the functions for setting HP, AP, and gravity?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Mirun.Frontier
Member
Join Date: Aug 2008
Old 03-08-2010 , 23:38   Re: Help with Setting HP,AP,Gravity,etc..
Reply With Quote #3

I meant like a player opens a menu by typing /class, then chooses a class, and his/her hp/ap/gravity gets changed right after choosing.
__________________
I can't believe I wasted 5 years of my life not knowing how to program correctly. Went too deep into advanced coding before even learning the basics correctly. :c
Mirun.Frontier is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-08-2010 , 23:49   Re: Help with Setting HP,AP,Gravity,etc..
Reply With Quote #4

PHP Code:
// ...

public plugin_init()
{
    
register_plugin"a""1.0""Wrecked" )
    
    
register_clcmd"say /class""yourfunc" )
}

public 
yourfuncid )
{
    new 
menu menu_create"Choose Your Class:""menu_handler" )

    
menu_additemmenu"Option 1""1")
    
menu_additemmenu"Option 2""2")

    
menu_setpropmenuMPROP_EXITMEXIT_ALL // adds exit option

    
menu_displayidmenu// 3rd param is page to start on, rest self expl

    
return PLUGIN_CONTINUE;
}

public 
menu_handleridmenuitem // see AMXX Menu tut, not going to explain all
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6]
    new 
name[64]
    new 
access
    
new callback
    
    menu_item_getinfo
menuitemaccessdata5name63callback )
    
    new 
choice str_to_numdata )
    
    switch( 
choice )
    {
        case 
1// Chose option 1
        
{
            
// Set effects
        
}
        
        case 
2// opt 2
        
{
            
// effects
        
}
    }
    
    
menu_destroymenu )
    
    return 
PLUGIN_HANDLED;

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 18:48.


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