Raised This Month: $ Target: $400
 0% 

error 088: number of arguments does not match definition


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-10-2022 , 14:23   Re: error 088: number of arguments does not match definition
Reply With Quote #11

By using the AddCommas() function.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-10-2022 , 17:17   Re: error 088: number of arguments does not match definition
Reply With Quote #12

Quote:
Originally Posted by OciXCrom View Post
By using the AddCommas() function.
Hello.

The AddCommas function is already used and wired with the code responsible for displaying the ZP HUD info message, didn't you see the code i shared?

This is how the whole code looks now:

PHP Code:
    if (id != ID_SHOWHUD)
    {
        
// Show name, health, class, and ammo packs and armor
        
set_dhudmessage(600HUD_SPECT_XHUD_SPECT_Y16.01.10.00.0)
        
show_dhudmessage(ID_SHOWHUD"%L %s^nHP: %d || %L %s || %L %d || %L %d"ID_SHOWHUD"SPECTATING"g_playername[id],
        
pev(idpev_health), ID_SHOWHUD"CLASS_CLASS", class, ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[id], ID_SHOWHUD"ARMOR"pev(idpev_armorvalue))
    }
    else
    {
        new 
szXPCommas16 ], szNextXPCommas16 ], szAPCodmas16 ];
        
AddCommascrxranks_get_user_xpid ), szXPCommaschardmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommascdarsmaxsdNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) );

        
// Show health, class and ammo packs and armor
        
set_dhudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y03.01.10.00.0)
        
show_dhudmessage(ID_SHOWHUD"%d: %d || %d %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s"id"ZOMBIE_ATTRIB"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
        class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"AMOR"pev(ID_SHOWHUDpev_armorvalue), szXPCommasszNextXPCommascrxranks_get_user_level(id), crxranks_get_max_levels(), ranknameszAPCommas )
    }

As you can see, the AddCommas function is already there.

Despite the fact the AddCommas function is there, it still doesn't work for the Ammo and the Health, but only for the rank XP.

Here is again description of the problem:

Quote:
Originally Posted by GlobalPlague View Post
Now it works, but only for the rank XP, and not for the health and the ammo.

This is how the HUD message looks now: https://pasteboard.co/SAkLIz2u85Z0.png

This is the code:

Code:
show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %d || %L %d || %L %d^nXP: %d/%d | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
This is how it looks when i edit it, and change "%d" with "%s" for the Health and the Ammo: https://pasteboard.co/hNdkZwPllnqD.png

This is the code:

Code:
show_dhudmessage(ID_SHOWHUD, "%L: %s || %L %s || %L %s || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
So, how do i solve this problem?

Last edited by GlobalPlague; 03-11-2022 at 15:11.
GlobalPlague is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-10-2022 , 17:27   Re: error 088: number of arguments does not match definition
Reply With Quote #13

Quote:
Originally Posted by GlobalPlague View Post
Now it works, but only for the rank XP, and not for the health and the ammo.

This is how the HUD message looks now: https://pasteboard.co/SAkLIz2u85Z0.png

This is the code:

Code:
show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
This is how it looks when i edit it, and change "%d" with "%s" for the Health and the Ammo: https://pasteboard.co/hNdkZwPllnqD.png

This is the code:

Code:
show_dhudmessage(ID_SHOWHUD, "%L: %s || %L %s || %L %s || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
So, how do i solve this problem?
I told you, dont copy and paste the code try to learn how this work, next time make request on suggest/request section

PHP Code:
// Create string
new szXPCommas16 ], szNextXPCommas16 ], szAPCommas16 ]; 
// Use AddCommas by the string
        
AddCommascrxranks_get_user_xpid ), szXPCommascharsmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommascharsmaxszNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) ); 
// Then use the sting for format
Quote:
show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), szXPCommas, szNextXPCommas, crxranks_get_user_level(id), crxranks_get_max_levels(), rankname, szAPCommas )
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 03-10-2022 at 17:31.
Supremache is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-10-2022 , 18:01   Re: error 088: number of arguments does not match definition
Reply With Quote #14

So where exactly are you using the AddCommas() function on the health?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-11-2022 , 06:27   Re: error 088: number of arguments does not match definition
Reply With Quote #15

Quote:
Originally Posted by Supremache View Post
I told you, dont copy and paste the code try to learn how this work, next time make request on suggest/request section

PHP Code:
// Create string
new szXPCommas16 ], szNextXPCommas16 ], szAPCommas16 ]; 
// Use AddCommas by the string
        
AddCommascrxranks_get_user_xpid ), szXPCommascharsmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommascharsmaxszNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) ); 
// Then use the sting for format
Don't i use it correctly?

Code:
		show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
		class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), szXPCommas, szNextXPCommas, crxranks_get_user_level(id), crxranks_get_max_levels(), rankname, szAPCommas )
The "szAPCommas" is there, as you can see. "AP" means ammo packs, right? So, this is the code that should add a comma to the ammo packs (e.g. AP: 5,000).

In the following code:

Code:
show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s"
The red segment is the segment responsible for displaying the number of ammo packs. When i change it from this:

Code:
%L %d
To this:

Code:
%L %s
The HUD messages get changed from this: https://pasteboard.co/0CWrKd2i4PwA.png
To this: https://pasteboard.co/dW4ppe5T0IwZ.png

The number of ammo packs disappeared, and was replaced with ")", so the HUD turned from "Money: 13368" to "Money: (". There is a different symbol each time the server is restarted, but the number of ammo packs can't appear.

The following code:

PHP Code:
        new szXPCommas16 ], szNextXPCommas16 ], szAPCommas16 ];
        
AddCommascrxranks_get_user_xpid ), szXPCommascharsmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommascharsmaxszNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) ); 
Is already wired with the code responsible for displaying the HUD info message in ZP.

This:

PHP Code:
new szXPCommas16 ], szNextXPCommas16 ], szAPCommas16 ]; 
Is already in this code:

Code:
// Show health, class and ammo packs and armor
		set_dhudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0)
		show_dhudmessage(ID_SHOWHUD, "%L: %d || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
		class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), szXPCommas, szNextXPCommas, crxranks_get_user_level(id), crxranks_get_max_levels(), rankname, szAPCommas )
I marked it in red, so it can be easier to see it. Use the scroll bar to slide to the right, and you will see it.

So, as you can see, the codes are already in place, right?

Last edited by GlobalPlague; 03-11-2022 at 06:30.
GlobalPlague is offline
Dyaus
Member
Join Date: Aug 2021
Old 03-11-2022 , 08:52   Re: error 088: number of arguments does not match definition
Reply With Quote #16

they are in place but those are for XP and ammo , he meant use addcommas() on health and armor too , for example:
new szhealthcommas[16]
AddCommas(pev(ID_SHOWHUD, pev_health), szhealthcommas, charsmax( szhealthcommas ) );

now in show_hudmessage replace "pev(ID_SHOWHUD, pev_health)" with "szhealthcommas".

do the same for armor or whatever other value you want to add commas on
Dyaus is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-11-2022 , 13:19   Re: error 088: number of arguments does not match definition
Reply With Quote #17

Quote:
Originally Posted by Dyaus View Post
they are in place but those are for XP and ammo , he meant use addcommas() on health and armor too , for example:
new szhealthcommas[16]
AddCommas(pev(ID_SHOWHUD, pev_health), szhealthcommas, charsmax( szhealthcommas ) );

now in show_hudmessage replace "pev(ID_SHOWHUD, pev_health)" with "szhealthcommas".

do the same for armor or whatever other value you want to add commas on
No, it still doesn't work.

When i did what you described, the HUD message responsible for showing the amount of health got broken. Now, it doesn't matter if you are a human, zombie, Nemesis, Assassin, or sniper, i doesn't matter how much health you actually have, the hud will always show you have 54 health points.

For example, if you have 5000 health, it will be shows as 54 health.

Last edited by GlobalPlague; 03-11-2022 at 13:37.
GlobalPlague is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-11-2022 , 13:24   Re: error 088: number of arguments does not match definition
Reply With Quote #18

Quote:
Originally Posted by Supremache View Post
Again, again and again put string field not a number field
%d to %s
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-11-2022 , 15:12   Re: error 088: number of arguments does not match definition
Reply With Quote #19

Thanks, Supermache, for reminding me of this. Now, it works.

The problem is that it still doesn't work for the ammo packs.

So, i have already inserted the codes other people told me to insert in the main plugin of ZP.

Now, we have this code:

Code:
new szXPCommas[ 16 ], szNextXPCommas[ 16 ], szAPCommas[ 16 ];
AddCommas( g_ammopacks[id], szAPCommas, charsmax( szAPCommas ) );
This is the rest of the code:

Code:
set_dhudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0)
show_dhudmessage(ID_SHOWHUD, "%L: %s || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", szHPCommas, ID_SHOWHUD, "CLASS_CLASS",
class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), szXPCommas, szNextXPCommas, crxranks_get_user_level(id), crxranks_get_max_levels(), rankname, szAPCommas )
When i change "%d" to "%s", the HUD messages get changed from this: https://pasteboard.co/0CWrKd2i4PwA.png
To this: https://pasteboard.co/dW4ppe5T0IwZ.png

So, where is the problem?

Last edited by GlobalPlague; 03-11-2022 at 15:15.
GlobalPlague is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 03-11-2022 , 15:23   Re: error 088: number of arguments does not match definition
Reply With Quote #20

Quote:
Originally Posted by GlobalPlague View Post
Thanks, Supermache, for reminding me of this. Now, it works.

The problem is that it still doesn't work for the ammo packs.

So, i have already inserted the codes other people told me to insert in the main plugin of ZP.

Now, we have this code:

Code:
new szXPCommas[ 16 ], szNextXPCommas[ 16 ], szAPCommas[ 16 ];
AddCommas( g_ammopacks[id], szAPCommas, charsmax( szAPCommas ) );
This is the rest of the code:

Code:
set_dhudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0)
show_dhudmessage(ID_SHOWHUD, "%L: %s || %L %s || %L %d || %L %d^nXP: %s/%s | Level: %d/%d: %s", id, "ZOMBIE_ATTRIB1", szHPCommas, ID_SHOWHUD, "CLASS_CLASS",
class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue), szXPCommas, szNextXPCommas, crxranks_get_user_level(id), crxranks_get_max_levels(), rankname, szAPCommas )
When i change "%d" to "%s", the HUD messages get changed from this: https://pasteboard.co/0CWrKd2i4PwA.png
To this: https://pasteboard.co/dW4ppe5T0IwZ.png

So, where is the problem?
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache 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 02:46.


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