Raised This Month: $ Target: $400
 0% 

[HELP] Registering CMD to client_print


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 06-28-2009 , 03:48   [HELP] Registering CMD to client_print
Reply With Quote #1

Is this right?

register_clcmd( "say /myxp", "cmdMyxp" );
register_clcmd( "say_team /myxp", "cmdMyxp" );

public cmdMyxp
{
client_print ( id, print_chat, "Your is currently %s", iPoint )
}

if someone types /myxp


And how can i set it so that:

public Pmenu ( id )
{

new menu = menu_create ( "/rHide N Seek /yXP", "P_Menu" )

menu_additem ( menu, "\rGrenade \yMenu \r(Terrorist)", "1", 0 )
menu_additem ( menu, "\rHealth \yMenu", "2", 0 )
menu_additem ( menu, "\rArmor \yMenu" , "3", 0 )
menu_additem ( menu, "\rShop \yMenu", "4", 0 )
menu_additem ( menu, "\rBuy \yXP", "5", 0 )
menu_additem ( menu, "\rRevive - \y50 points", "6", 0 )

menu_setprop ( menu, MPROP_EXIT, MEXIT_NEVER );
menu_display (id, menu, 0 )
return PLUGIN_HANDLED;

I want it so on the menu under the title of the menu it says Your XP: %s <-- xp using iPoint

so itll look

Hide N Seek XP

Your XP: XPhere

Grenade Menu. blah blah

Last edited by malec321; 06-28-2009 at 03:51.
malec321 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-28-2009 , 04:01   Re: [HELP] Registering CMD to client_print
Reply With Quote #2

public cmdMyxp should be public cmdMyxp( id )
__________________
Arkshine is offline
malec321
Senior Member
Join Date: May 2009
Location: Los Angeles
Old 06-28-2009 , 04:05   Re: [HELP] Registering CMD to client_print
Reply With Quote #3

So basically
public cmdMyxp
{
client_print ( id, print_chat, "Your is currently %s", iPoint )
}

should be

public cmdMyxp( id )
{
client_print ( id, print_chat, "Your is currently %s", iPoint )
}
malec321 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-28-2009 , 12:17   Re: [HELP] Registering CMD to client_print
Reply With Quote #4

Yes.

Also, use [php][/php] tags around any code that you post.

For you second question, use
PHP Code:
/**
 * Adds a text line to a menu.  Only available in amxmodx 1.8.1 and above.
 *
 * @param menu            Menu resource identifier.
 * @param text            Text to add.
 * @param slot            1 (default) if the line should shift the numbering down.
 *                         0 if the line should be a visual shift only.
 * @noreturn
 * @error                Invalid menu resource.
 */
native menu_addtext(menu, const text[], slot=1); 
PHP Code:
new stringvar[15]

formatex(stringvar14"Your XP: %d", <user's xp variabl here>)

menu_addtext(menu, stringvar, 0) 
__________________
fysiks is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-28-2009 , 18:02   Re: [HELP] Registering CMD to client_print
Reply With Quote #5

After sometests... menu_addtext hardly fails, and buttons are fucked x'D
__________________
xPaw 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 15:38.


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