Raised This Month: $32 Target: $400
 8% 

Compile Error In A Plugin!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anonymousstar
Junior Member
Join Date: Apr 2020
Old 04-13-2020 , 08:33   Compile Error In A Plugin!
Reply With Quote #1

help me

Code:

public fw_touch(toucher, touched)
{
if (block)
{
if (!is_valid_ent(toucher))
{
return 1;
}
static class[32];
entity_get_string(toucher, g_szSecondary, class, 31);
//new var2;//
if (1 <= touched <= 32 && (equali(class, "weaponbox", g_szSecondary) || equali(class, "armoury_entity", g_szSecondary) || equali(class, "weapon_shield", g_szSecondary)))
{
return 4;
}
}
return 1;
}

Error Shown Is:

Error:
Error: Argument type mismatch (argument 2) on line 464
Error: Argument type mismatch (argument 3) on line 466
Anonymousstar is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-13-2020 , 08:44   Re: Compile Error In A Plugin!
Reply With Quote #2

At least tell us which are lines 464 and 466.
Show the definition for "g_szSecondary".

Code:
entity_get_string(toucher, g_szSecondary, class, 31) equali(class, "weaponbox", g_szSecondary)

The first function requires a string as the second parameter and the second one requires an integer.
You're using the same variable in both, so there's clearly something wrong. I'm assuming "g_szSecondary" is a string, so you can't use it as the 3rd parameter in "equali".

https://www.amxmodx.org/api/string/equali
__________________

Last edited by OciXCrom; 04-13-2020 at 08:46.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Anonymousstar
Junior Member
Join Date: Apr 2020
Old 04-13-2020 , 12:46   Re: Compile Error In A Plugin!
Reply With Quote #3

Defination of g_szSecondary:

new g_szSecondary[6][66] =
{
{
71, 108, 111, 99, 107, 49, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 103, 108, 111, 99, 107, 49, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 17
},
{
85, 115, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 117, 115, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 16
},
{
80, 50, 50, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 112, 50, 50, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 1
},
{
68, 117, 97, 108, 32, 69, 108, 105, 116, 101, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 101, 108, 105, 116, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 10
},
{
70, 105, 118, 101, 115, 101, 118, 101, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 102, 105, 118, 101, 115, 101, 118, 101, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 11
},
{
68, 101, 97, 103, 108, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, 101, 97, 112, 111, 110, 95, 100, 101, 97, 103, 108, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 26
}
};
Anonymousstar is offline
Anonymousstar
Junior Member
Join Date: Apr 2020
Old 04-13-2020 , 12:54   Re: Compile Error In A Plugin!
Reply With Quote #4

Line 456: public fw_touch(toucher, touched)
Line 457: {
Line 458: if (block)
Line 459: {
Line 460: if (!is_valid_ent(toucher))
Line 461: {
Line 462: return 1;
Line 463: }
Line 464: static class[32];
Line 465: entity_get_string(toucher, g_szSecondary, class, 31);
Line 466: if (1 <= touched <= 32 && (equali(class, "weaponbox", g_szSecondary) || equali(class, "armoury_entity", g_szSecondary) || equali(class, "weapon_shield", g_szSecondary)))
Line 467: {
Line 468: return 4
Line 469: }
Line 470: }
Line 471: return 1;
Line 472: }


Error:

Error: Argument type mismatch (argument 2) on line 465
Error: Argument type mismatch (argument 3) on line 466
Anonymousstar is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-13-2020 , 14:41   Re: Compile Error In A Plugin!
Reply With Quote #5

Is that a decompiled plugin or a complete disaster? Either way, I told you what the problem is. That's all I can say by looking at that mess. Post the full code if you want help.
__________________

Last edited by OciXCrom; 04-13-2020 at 14:43.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 16:47.


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