Raised This Month: $ Target: $400
 0% 

Speed and menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fixed
Member
Join Date: Feb 2010
Old 03-05-2010 , 15:34   Speed and menu
Reply With Quote #1

How to get a player extra speed?
And I dont understand the menu system. Example menu:

1. Get speed

and all that...
When u press 1 you shall get extra speed?

Please help!
__________________
fixed is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 15:48   Re: Speed and menu
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=46364

Code:
// plugin shit public CMD_Menu( id ) {     new menu = menu_create( "Your Menu Name", "func_handler" )         menu_additem( menu, "Speed", "1", 0 ) // menu id, option, data, access     menu_additem( menu, "Other", "2", 0 )         menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ) // adding exit         menu_display( id, menu, 0 ) // p index, menu id, page         return PLUGIN_CONTINUE; } public func_handler( id, menu, item ) {     if( item == MENU_EXIT )     {         menu_destroy( menu )                 return PLUGIN_HANDLED;     }         new access, callback, name[64], data[6]         menu_item_getinfo( menu, item, access, data, 5, name, 63, callback )         new choice = str_to_num( data )         switch( choice )     {         case 1: // Speed         {             // Method of setting speed for id         }                 case 2: // Other         {             // ...         }         // ...     }         menu_destroy( menu )         return PLUGIN_HANDLED; }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fixed
Member
Join Date: Feb 2010
Old 03-05-2010 , 15:54   Re: Speed and menu
Reply With Quote #3

awesome thanks dude now I just need the speed
__________________
fixed is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 16:07   Re: Speed and menu
Reply With Quote #4

PHP Code:
set_pevidpev_maxspeed300.0 // must be float, fakemeta way
// or
set_user_maxspeedid300.0 // same, fun way 
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fixed
Member
Join Date: Feb 2010
Old 03-05-2010 , 16:17   Re: Speed and menu
Reply With Quote #5

Thanks, but I cant get this menu to work. Im more familiar to the new menu "generator like"

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /selectitem""func_handler")

    new 
menu menu_create"Your Menu Name""func_handler" )
    
    
menu_additemmenu"Speed""1"// menu id, option, data, access
    
menu_additemmenu"Other""2")
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL // adding exit
    
    
menu_displayidmenu// p index, menu id, page
    
    
return PLUGIN_CONTINUE;
}


public 
func_handleridmenuitem )
{

    
    
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
accesscallbackname[64], data[6]
    
    
menu_item_getinfomenuitemaccessdata5name63callback )
    
    new 
choice str_to_numdata )
    
    switch( 
choice )
    {
        case 
1// Speed
        
{

        }
        
        case 
2// Other
        
{
            
// ...
        
}
        
// ...
    
}
    
    
menu_destroymenu )
    
    return 
PLUGIN_HANDLED;

It says error, and it dosent work with the other code :S
__________________
fixed is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 16:24   Re: Speed and menu
Reply With Quote #6

What error?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fixed
Member
Join Date: Feb 2010
Old 03-05-2010 , 16:31   Re: Speed and menu
Reply With Quote #7

menu_display( id, menu, 0 ) // p index, menu id, page

this line!

ID error and its says that it dosent have any effect :S
__________________
fixed is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 16:38   Re: Speed and menu
Reply With Quote #8

Oh, that's because you have the display in plugin_init which has no player id stored.

Display the menu in a different function that has a player id stored.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fixed
Member
Join Date: Feb 2010
Old 03-05-2010 , 16:43   Re: Speed and menu
Reply With Quote #9

Thanks works now

EDIT:
What is the command for give weapons like smoke grenade?
__________________
fixed is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 16:46   Re: Speed and menu
Reply With Quote #10

PHP Code:
give_itemid"weapon_smokegrenade" 
__________________
[ 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 08:42.


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