AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with Setting HP,AP,Gravity,etc.. (https://forums.alliedmods.net/showthread.php?t=120786)

Mirun.Frontier 03-07-2010 23:33

Help with Setting HP,AP,Gravity,etc..
 
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?

wrecked_ 03-07-2010 23:45

Re: Help with Setting HP,AP,Gravity,etc..
 
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?

Mirun.Frontier 03-08-2010 23:38

Re: Help with Setting HP,AP,Gravity,etc..
 
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.

wrecked_ 03-08-2010 23:49

Re: Help with Setting HP,AP,Gravity,etc..
 
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;




All times are GMT -4. The time now is 08:39.

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