Raised This Month: $ Target: $400
 0% 

USP Reloaded v5.1 [Last Update: 31/10/09]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-24-2009 , 13:24   Re: USPR v3.0
Reply With Quote #1

1. The code is still not indented properly.

2. Your menu should be callbacked.

Code:
new g_Callback[ 2 ]; public plugin_init( ) {     g_Callback[ 0 ] = menu_makecallback( "MenuCallbackEnabled" );     g_Callback[ 1 ] = menu_makecallback( "MenuCallbackDisabled" ); } public USPMenu( id ) {     new USP = menu_create( "\yChoose Your Type of \rUSP", "USPMenu_Handler" );         menu_additem( USP, "\wNormal USP \r[$800]^n", "1", cs_get_user_money( id ) > get_pcvar_num( cost_Normal_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );     menu_additem( USP, "\wReloaded USP \r[$5000]^n", "2", cs_get_user_money( id ) > get_pcvar_num( cost_Reloaded_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );         menu_display( id, USP, 0 ); } public MenuCallbackEnabled( id, menu, item ) {     return ITEM_ENABLED; } public MenuCallbackDisabled( id, menu, item ) {     return ITEM_DISABLED; }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 10-24-2009 at 13:25. Reason: typo
Xellath is offline
metallicawOw
Veteran Member
Join Date: Jun 2009
Location: Anywhere
Old 10-24-2009 , 14:56   Re: USPR v3.0
Reply With Quote #2

Quote:
Originally Posted by Xellath View Post
1. The code is still not indented properly.

2. Your menu should be callbacked.

Code:
new g_Callback[ 2 ];

public plugin_init( ) {     g_Callback[ 0 ] = menu_makecallback( "MenuCallbackEnabled" );
    g_Callback[ 1 ] = menu_makecallback( "MenuCallbackDisabled" );
} public USPMenu( id ) {     new USP = menu_create( "\yChoose Your Type of \rUSP", "USPMenu_Handler" );
    
    menu_additem( USP, "\wNormal USP \r[$800]^n", "1", cs_get_user_money( id ) > get_pcvar_num( cost_Normal_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );
    menu_additem( USP, "\wReloaded USP \r[$5000]^n", "2", cs_get_user_money( id ) > get_pcvar_num( cost_Reloaded_USP ) ? g_Callback[ 0 ] : g_Callback[ 1 ] );
    
    menu_display( id, USP, 0 );
} public MenuCallbackEnabled( id, menu, item ) {     return ITEM_ENABLED; } public MenuCallbackDisabled( id, menu, item ) {     return ITEM_DISABLED; }

i dont understand your callbacks metod, i try to do it but I do not work like i was waiting.

New Version v4.0!
__________________

metallicawOw 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 04:48.


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