Raised This Month: $51 Target: $400
 12% 

How to add comma ?


Post New Thread Reply   
 
Thread Tools Display Modes
Nano x
Member
Join Date: Feb 2014
Location: Lebanon, beirut
Old 11-21-2015 , 18:27   Re: How to add comma ?
Reply With Quote #11

thank you very much but still not working no comma, can you do the full plugin code please, sorry for wasting your time
Nano x is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-21-2015 , 18:31   Re: How to add comma ?
Reply With Quote #12

Quote:
Originally Posted by Nano x View Post
thank you very much but still not working no comma, can you do the full plugin code please, sorry for wasting your time
That's because you are only using it in plugin_init(). Why would it work in your chat if you aren't using it there?
PHP Code:
public Task_ShowHealth(id)
{
    
id -= TASK_HEALTH
    
    
if (!zp_get_user_sniper(id))
        
remove_task(id+TASK_HEALTH)
    
    new 
szHealth15 ];
    
AddCommasget_user_health(id) , szHealth charsmaxszHealth ) )
    
ColorChat(0GREY"^x04[ZP]^x01 A ^x03Rapture^x01 Reminder ^x03@^x01 ^x04Sniper^x01 still has ^3%s ^x04health points!^x01"szHealth)

__________________
Bugsy is offline
Nano x
Member
Join Date: Feb 2014
Location: Lebanon, beirut
Old 11-21-2015 , 18:49   Re: How to add comma ?
Reply With Quote #13

thank you very much, finally worked
Nano x is offline
Nano x
Member
Join Date: Feb 2014
Location: Lebanon, beirut
Old 11-23-2015 , 14:12   Re: How to add comma ?
Reply With Quote #14

greenzombie this is not plugin, you need to add the code in the plugin that you need to add comma in it.
Nano x is offline
Nano x
Member
Join Date: Feb 2014
Location: Lebanon, beirut
Old 11-24-2015 , 11:42   Re: How to add comma ?
Reply With Quote #15

hey in need more help please how to add comma here
PHP Code:
// Zombie Class Menu
public show_menu_zclass(id)
{
    
// Player disconnected
    
if (!g_isconnected[id])
        return;
    
    
// Bots pick their zombie class randomly
    
if (g_isbot[id])
    {
        
g_zombieclassnext[id] = random_num(0g_zclass_i 1)
        return;
    }
    
    static 
menuidmenu[128], class, buffer[32], buffer2[32]
    
    
// Title
    
formatex(menucharsmax(menu), "%L\r"id"MENU_ZCLASS_TITLE")
    
menuid menu_create(menu"menu_zclass")
    
    
// Class List
    
for (class = 0; class < g_zclass_i; class++)
    {
        
// Retrieve name and info
        
ArrayGetString(g_zclass_name, class, buffercharsmax(buffer))
        
ArrayGetString(g_zclass_info, class, buffer2charsmax(buffer2))
        
        
// Add to menu
        
if (class == g_zombieclassnext[id])
            
formatex(menucharsmax(menu), "\d%s %s"bufferbuffer2)
        else
            
formatex(menucharsmax(menu), "%s \y%s"bufferbuffer2)
        
        
buffer[0] = class
        
buffer[1] = 0
        menu_additem
(menuidmenubuffer)
    }
    
    
// Back - Next - Exit
    
formatex(menucharsmax(menu), "%L"id"MENU_BACK")
    
menu_setprop(menuidMPROP_BACKNAMEmenu)
    
formatex(menucharsmax(menu), "%L"id"MENU_NEXT")
    
menu_setprop(menuidMPROP_NEXTNAMEmenu)
    
formatex(menucharsmax(menu), "%L"id"MENU_EXIT")
    
menu_setprop(menuidMPROP_EXITNAMEmenu)
    
    
menu_display(idmenuid)

and here
PHP Code:
// Show the notice
                 
set_hudmessage(red50blue, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_MsgSync3,"%L"id"AIM_INFO"g_playername[aimid], class, pev(aimidpev_health), pev(aimidpev_armorvalue), g_ammopacks[aimid]) 
Nano x is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-24-2015 , 20:03   Re: How to add comma ?
Reply With Quote #16

Nothing in that code that you posted needs commas. If you still believe that you need commas, you need to be more specific about which variable needs them.
__________________

Last edited by fysiks; 11-24-2015 at 20:03.
fysiks is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-24-2015 , 23:06   Re: How to add comma ?
Reply With Quote #17

PHP Code:
qwerty(number 0

 static 
str[15], strpointed[15], lenci
 num_to_str
(numberstr14
 
len strlen(str
 
strpointed "" 
  
 
for (leni++) 
 { 
  if (
!= && ((len-i)%3==0)) 
  { 
   
add(strpointed14","1
   
c++ 
   
add(strpointed[i+c], 1str[i], 1
  } 
  else 
add(strpointed[i+c], 1str[i], 1
 } 

 return 
strpointed 

Include this stock.
Then wrap your variable with >> qwerty(YOUR VARIABLE)
Ex: qwerty(pev(aimid, pev_health))

Last edited by Chihuahuax; 11-24-2015 at 23:07.
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-24-2015 , 23:33   Re: How to add comma ?
Reply With Quote #18

Quote:
Originally Posted by Chihuahuax View Post
Include this stock.
Then wrap your variable with >> qwerty(YOUR VARIABLE)
Ex: qwerty(pev(aimid, pev_health))
No. It is not proper to return a string. Strings should only be passed by reference in this programming language. Bugsy has posted a proper function do do this already.
__________________
fysiks is offline
Nano x
Member
Join Date: Feb 2014
Location: Lebanon, beirut
Old 11-25-2015 , 18:34   Re: How to add comma ?
Reply With Quote #19

sorry i have post the wrong code this is the code that i need to add comma in
PHP Code:
// Zombie Class Menu
public menu_zclass(idmenuiditem)
{
    
// Menu was closed
    
if (item == MENU_EXIT)
    {
        
menu_destroy(menuid)
        return 
PLUGIN_HANDLED;
    }
    
    
// Retrieve zombie class id
    
static buffer[2], dummyclassid
    menu_item_getinfo
(menuiditemdummybuffercharsmax(buffer), __dummy)
    
classid buffer[0]
    
    
// Store selection for the next infection
    
g_zombieclassnext[id] = classid
    
    
static name[32]
    
ArrayGetString(g_zclass_nameg_zombieclassnext[id], namecharsmax(name))
    
    
// Show selected zombie class info and stats
    
zp_colored_print(id"^x04[ZP]^x01 %L^x01:^x04 %s"id"ZOMBIE_SELECT"name)
    
zp_colored_print(id"^x04[ZP]^x01 %L^x01:^x04 %d^x01 |^x01 %L^x01:^x04 %d^x01 |^x01 %L^x01:^x04 %d^x01 |^x01 %L^x01:^x04 %d%%"id"ZOMBIE_ATTRIB1"ArrayGetCell(g_zclass_hpg_zombieclassnext[id]), id"ZOMBIE_ATTRIB2"ArrayGetCell(g_zclass_spdg_zombieclassnext[id]),
    
id"ZOMBIE_ATTRIB3"floatround(Float:ArrayGetCell(g_zclass_gravg_zombieclassnext[id]) * 800.0), id"ZOMBIE_ATTRIB4"floatround(Float:ArrayGetCell(g_zclass_kbg_zombieclassnext[id]) * 100.0))
    
    
menu_destroy(menuid)
    return 
PLUGIN_HANDLED;

, this plugins has lang file,i need comma in the one that have line under it
PHP Code:
zp_colored_print(id"^x04[ZP]^x01 %L^x01:^x04 %d^x01 |^x01 %L^x01:^x04  %d^x01 |^x01 %L^x01:^x04 %d^x01 |^x01 %L^x01:^x04 %d%%" 
[ZP]^x01 %L^x01:^x04 %d^x01 = health:%d

Last edited by Nano x; 11-25-2015 at 18:57. Reason: more details
Nano x 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 20:50.


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