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

Solved using native in formatex


Post New Thread Reply   
 
Thread Tools Display Modes
lexzor
Veteran Member
Join Date: Nov 2020
Old 10-03-2021 , 21:53   Re: using native in formatex
Reply With Quote #11

actually i get same error in 1.10.0

i used if anyway

thanks you all
lexzor is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 10-04-2021 , 16:20   Re: using native in formatex
Reply With Quote #12

@fysiks. Thanks. I got the code reposted that does compile. Lexzor it was how you wanted it. I think. Whenever I have compiler errors from such like the other guys were saying it is hardly worth the time fighting it. Do it the less pretty way. It's more reliable.
__________________

Last edited by DJEarthQuake; 10-04-2021 at 16:26.
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-04-2021 , 17:02   Re: using native in formatex
Reply With Quote #13

Quote:
Originally Posted by fysiks View Post
What? Everything that was needed to reproduce the error was provided.
How do you know ? The error variable is unknown..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-04-2021 , 18:47   Re: using native in formatex
Reply With Quote #14

Quote:
Originally Posted by Natsheh View Post
How do you know ? The error variable is unknown..
The compiler is just confused, the code is syntactically correct.
__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-04-2021 , 21:54   Re: using native in formatex
Reply With Quote #15

Quote:
Originally Posted by Natsheh View Post
How do you know ? The error variable is unknown..
Because I reproduced the error exactly as the OP stated with the code that he provided and there were no missing variable/symbols. I even did some modifications to try and narrow it down and it seems like it must be a compiler error.

The errored variable is unknown because the compiler is confused.

As Bugsy stated, it is syntactically correct.

Quote:
Originally Posted by DJEarthQuake View Post
@fysiks. Thanks. I got the code reposted that does compile. Lexzor it was how you wanted it. I think. Whenever I have compiler errors from such like the other guys were saying it is hardly worth the time fighting it. Do it the less pretty way. It's more reliable.
The code you posted is not equivalent to the OP's code. You changed an empty string variable to the player's name.

I would probably do it this way which compiles successfully with 1.9.0:

PHP Code:
#include amxmodx

enum _:USER_INFO
{
    
szName[MAX_NAME_LENGTH],
    
szAuthid[MAX_AUTHID_LENGTH],
    
iIsUserClanLeader,
    
iIsUserClanSecondLeader,
    
iIsUserClanMember,
    
ClanName[MAX_NAME_LENGTH 4],
    
ClanTag[10]
}

new 
g_UserData[MAX_PLAYERS 1][USER_INFO];

new 
szItem[2][MAX_AUTHID_LENGTH];  

public 
whatever(id)
{
    new 
szTemp[33]
    
copy(szTempcharsmax(szTemp), g_UserData[id][ClanName]);
    
formatex(szItem[0], charsmax(szItem[]), "\r%L \y%s"id"CREATE_CLAN_NAME_FIELD"equali(g_UserData[id][ClanName], "NONE") ? "" szTemp);

__________________

Last edited by fysiks; 10-04-2021 at 22:24.
fysiks is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-04-2021 , 23:03   Re: using native in formatex
Reply With Quote #16

I would just set g_UserData[id][ClanName][ 0 ] to EOS instead of populating this string with "NONE" and call it a day. Updating all other code that looks for "NONE" accordingly.
__________________

Last edited by Bugsy; 10-04-2021 at 23:04.
Bugsy is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 10-05-2021 , 05:46   Re: using native in formatex
Reply With Quote #17

i will get rid of that NONE, i started the plugin fromating that string like that and now there are too many things to edit.

thanks you all.
lexzor 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 23:23.


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