AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error 088: number of arguments does not match definition (https://forums.alliedmods.net/showthread.php?t=336716)

GlobalPlague 03-08-2022 15:00

error 088: number of arguments does not match definition
 
I don't know what happened, but now i'm getting the following error when i try to compile the main plugin of my ZP server:

C:\mod\cstrike\addons\amxmodx\scripting\zombi e_plague_advance_v1-6-1.sma(11136 -- 11137) : error 088: number of arguments does not match definition

This is the code that is causing the error:

PHP Code:

// Show health, class and ammo packs and armor
        
set_dhudmessage(redgreenblueHUD_STATS_XHUD_STATS_Y06.01.10.00.0)
        
show_dhudmessage(ID_SHOWHUD"%L: %d || %L %s || %L %d || %L %d^nXP: %d/%d | Level: %d/%d: %s"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
        class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"ARMOR"pev(ID_SHOWHUDpev_armorvalue), crxranks_get_user_xp(id), crxranks_get_user_next_xp(id), crxranks_get_user_level(id), crxranks_get_max_levels(), ranknameAddCommas(g_ammopacks[id]))show_dhudmessage(ID_SHOWHUD"%L: %d || %L %s || %L %d || %L %d^nXP: %d/%d | Level: %d/%d: %s"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
        class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"ARMOR"pev(ID_SHOWHUDpev_armorvalue), crxranks_get_user_xp(id), crxranks_get_user_next_xp(id), crxranks_get_user_level(id), crxranks_get_max_levels(), ranknameAddCommas(g_ammopacks[id])) 

This is line 11136-11137:

PHP Code:

show_dhudmessage(ID_SHOWHUD"%L: %d || %L %s || %L %d || %L %d^nXP: %d/%d | Level: %d/%d: %s"id"ZOMBIE_ATTRIB1"pev(ID_SHOWHUDpev_health), ID_SHOWHUD"CLASS_CLASS",
        class, 
ID_SHOWHUD"AMMO_PACKS1"g_ammopacks[ID_SHOWHUD], ID_SHOWHUD"ARMOR"pev(ID_SHOWHUDpev_armorvalue), crxranks_get_user_xp(id), crxranks_get_user_next_xp(id), crxranks_get_user_level(id), crxranks_get_max_levels(), ranknameAddCommas(g_ammopacks[id])) 

So, would someone explain to me how to fix the error?

Thanks.

OciXCrom 03-08-2022 15:03

Re: error 088: number of arguments does not match definition
 
Didn't you already post a thread about the same error, same function? You were already told that's not how you use the AddCommas() function.

GlobalPlague 03-08-2022 15:10

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by OciXCrom (Post 2773503)
Didn't you already post a thread about the same error, same function? You were already told that's not how you use the AddCommas() function.

Hello.

No. My previous two threads were only about the AddCommas function, and not about solving errors.

Someone else already told me how exactly to use the AddCommas functions. I want to use the AddCommas function on this code, but firstly i want to fix the error caused by the code i want to use the AddCommas function on.

The problem is that i don't know how to fix the error. So, even if i add the AddCommas function, the code still won't work, because the error isn't fixed.

Dyaus 03-08-2022 18:52

Re: error 088: number of arguments does not match definition
 
post this function and its return value here : AddCommas()

fysiks 03-08-2022 21:54

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by GlobalPlague (Post 2773505)
Hello.

No. My previous two threads were only about the AddCommas function, and not about solving errors.

Someone else already told me how exactly to use the AddCommas functions. I want to use the AddCommas function on this code, but firstly i want to fix the error caused by the code i want to use the AddCommas function on.

The problem is that i don't know how to fix the error. So, even if i add the AddCommas function, the code still won't work, because the error isn't fixed.

You literally already posted this exact question here and it was explained to you why it was causing errors.

Quote:

Originally Posted by Dyaus (Post 2773523)
post this function and its return value here : AddCommas()

See the thread I linked above.

Supremache 03-09-2022 02:05

Re: error 088: number of arguments does not match definition
 
Again !!!
https://forums.alliedmods.net/showpo...57&postcount=6

GlobalPlague 03-09-2022 09:07

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by Supremache (Post 2773550)

Back then, i saw your code, but i used it in the wrong way, which is why it didn't work, and i decided to post another thread about the same error.

Now, i used it correctly, and it worked.

Problem solved.

Thanks.

GlobalPlague 03-09-2022 09:50

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by Supremache (Post 2773550)

Wait... it still doesn't work as i expected it to work. Although the code can now be compiled without any errors, the code still doesn't work as it should work.

This is how the HUD looked like before i added the new codes: https://pasteboard.co/oHLwxDhrvQhg.png

This is how the HUD looks like now after i added the new codes: https://pasteboard.co/kfrW0AZggIpR.png

This is the way i made the code to be:

PHP Code:

// Spectating someone else?
    
if (id != ID_SHOWHUD)
    {
        
// Show name, health, class, and ammo packs and armor
        
set_dhudmessage(000HUD_SPECT_XHUD_SPCT_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 ], szAPCommas16 ];
        
AddCommascrxranks_get_user_xpid ), szXPCommascharsmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommaschrsmaxszNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) );

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


The segment of the HUD, that shows the rank XP doesn't work.

It has to be like it is in the first photo, not just "54/54"...

Supremache 03-09-2022 10:28

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by GlobalPlague (Post 2773585)
Wait... it still doesn't work as i expected it to work. Although the code can now be compiled without any errors, the code still doesn't work as it should work.

This is how the HUD looked like before i added the new codes: https://pasteboard.co/oHLwxDhrvQhg.png

This is how the HUD looks like now after i added the new codes: https://pasteboard.co/kfrW0AZggIpR.png

This is the way i made the code to be:

PHP Code:

// Spectating someone else?
    
if (id != ID_SHOWHUD)
    {
        
// Show name, health, class, and ammo packs and armor
        
set_dhudmessage(000HUD_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 ], szAPCommas16 ];
        
AddCommascrxranks_get_user_xpid ), szXPCommascharsmaxszXPCommas ) );
        
AddCommascrxranks_get_user_next_xp(id), szNextXPCommascharsmaxszNextXPCommas ) );
        
AddCommasg_ammopacks[id], szAPCommascharsmaxszAPCommas ) );

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


The segment of the HUD, that shows the rank XP doesn't work.

It has to be like it is in the first photo, not just "54/54"...

Again, again and again put string field not a number field
%d to %s

GlobalPlague 03-10-2022 09:55

Re: error 088: number of arguments does not match definition
 
Quote:

Originally Posted by Supremache (Post 2773588)
Again, again and again put string field not a number field
%d to %s

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?


All times are GMT -4. The time now is 15:20.

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