Raised This Month: $ Target: $400
 0% 

Menu add


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-07-2013 , 14:52   Menu add
Reply With Quote #1

Okay so this code shows all players on the server
something like this:
1. name
2. name

and i want to do the player who open the menu name red
and the others grey.
And i want to add text behind there names that telling them there precent
Code:
new percent = 100 * earned/total
like this
1. name [%i] Done
2. name [%i] Done

how can i do that??

Code:
    new iMenu = menu_create("\rPERCENT PLAYER MENU", "handlePlayerMenu");
   
    new iPlayers[32], iNum, iPlayer, szName[32], szKey[3];
    get_players(iPlayers, iNum);
   
    for( new i; i < iNum; i++ )
    {
        iPlayer = iPlayers[i];
        get_user_name(iPlayer, szName, charsmax(szName));
        num_to_str(iPlayer, szKey, charsmax(szKey));
        menu_additem(iMenu, szName, szKey);
    }
   
    menu_setprop(iMenu, MPROP_EXITNAME, "Back");
    menu_display(id, iMenu, 0);
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-07-2013 , 15:00   Re: Menu add
Reply With Quote #2

Percent of what?
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-07-2013 , 15:08   Re: Menu add
Reply With Quote #3

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
Percent of what?
i dont want help with percent i want help with the meny that shows percent
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-07-2013 , 15:09   Re: Menu add
Reply With Quote #4

PHP Code:
for( new iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
get_user_name(iPlayerszNamecharsmax(szName));
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
menu_additem(iMenuszNameszKey);
    } 
use formatting
PHP Code:
new szMenuKey[128],precent;
for( new 
iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
precent=100*earned/total;
        
get_user_name(iPlayerszNamecharsmax(szName));
        
format(szMenuKey,127,"%s [%d] done",szName,precent);
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
menu_additem(iMenuszMenuKeyszKey);
    } 
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-07-2013 , 15:27   Re: Menu add
Reply With Quote #5

But how can i make the persons name red and a space
Who Open the menu
1. MyName // and this line should be red With your name
// and here a space
2. Name
3. Name
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-07-2013 at 17:38.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-07-2013 , 19:27   Re: Menu add
Reply With Quote #6

PHP Code:
new szMenuKey[128],precent;
for( new 
iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
precent=100*earned/total;
        
get_user_name(iPlayerszNamecharsmax(szName));
        
format(szMenuKey,127,"%s%s \w[%d] done%s"== id "\r" "",szName,precent== id "^n" "");
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
menu_additem(iMenuszMenuKeyszKey);
    } 
I'm not sure if you can use ^n on this type of menus... but try it.
__________________

Last edited by Neeeeeeeeeel.-; 01-07-2013 at 19:27.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-08-2013 , 07:52   Re: Menu add
Reply With Quote #7

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
PHP Code:
new szMenuKey[128],precent;
for( new 
iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
precent=100*earned/total;
        
get_user_name(iPlayerszNamecharsmax(szName));
        
format(szMenuKey,127,"%s%s \w[%d] done%s"== id "\r" "",szName,precent== id "^n" "");
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
menu_additem(iMenuszMenuKeyszKey);
    } 
I'm not sure if you can use ^n on this type of menus... but try it.

your did not work
my name was white and the other players name was red
i want my name to be red and the other players red
and it was not a space
1. myname //red
//space
2. name
3. name
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-08-2013 , 08:36   Re: Menu add
Reply With Quote #8

PHP Code:
new szMenuKey[128],precent;
for( new 
iiNumi++ )
    {
        
iPlayer iPlayers[i];
        
precent=100*earned/total;
        
get_user_name(iPlayerszNamecharsmax(szName));
        
format(szMenuKey,127,"\r%s \w[%d] done^n",szName,precent);
        
num_to_str(iPlayerszKeycharsmax(szKey));
        
menu_additem(iMenuszMenuKeyszKey);
    } 
for more spaces: ^n and more: ^n^n^n^n^n
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 01-08-2013 at 08:37.
AngeIII is offline
Send a message via Skype™ to AngeIII
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-08-2013 , 08:39   Re: Menu add
Reply With Quote #9

use callback and set the formatting to according item from there
jimaway is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-08-2013 , 14:32   Re: Menu add
Reply With Quote #10

evryones names was red?
but the space work
Code:
    {
        iPlayer = iPlayers[i];
 new percent = 100 * iAchLevel[id][i]/iAchPoints[i]
        get_user_name(iPlayer, szName, charsmax(szName));
        format(szMenuKey,127,"\r%s \d[%d%%]\w^n",szName,percent);
        num_to_str(iPlayer, szKey, charsmax(szKey));
        menu_additem(iMenu, szMenuKey, szKey);
    }
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
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 13:25.


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