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

Solved amxxpc crashes when using tagof


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-06-2017 , 10:09   amxxpc crashes when using tagof
Reply With Quote #1

Code:
stock ArrayList.Clear( Arrayname )                  ArrayDestroy( Arrayname ); stock ArrayList.Get( Arrayname, key, var[] )        ArrayGetString( Arrayname, key, var, charsmax( var ) ) stock ArrayList.Count( Arrayname )                  ArraySize( Arrayname ); stock ArrayList.Add( Arrayname, string )            ArrayPushString( Arrayname, string ); stock ArrayList.Remove( Arrayname, {Int,String}:key[], tagType = tagof(key), exactMatch = true, maxBuff = 224 ){         if( tagType == tagof(Int:) ) ArrayDeleteItem( dynamicMenu, str_to_num(key) ) // = crash     else if( tagType == tagof(String:){ // = crash                 new var[maxBuff];         for( new i; i < ArrayList.Count( dynamicMenu ); i++ ){             ArrayList.Get( Arrayname, i, var )             if( exactMatch ?                 equal( var, key ) : ( containi(var, key ) != - 1  ) ){                 // Do something             }                     }     }    }
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.

Last edited by SpawnerF; 07-07-2017 at 09:15.
SpawnerF is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-06-2017 , 13:47   Re: amxxpc crashes when using tagof
Reply With Quote #2

i didn`t really get your problem. explain more
and this part of code isn`t enough to help.
__________________
retired chump

Last edited by DjSoftero; 07-06-2017 at 13:47.
DjSoftero is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-06-2017 , 15:02   Re: amxxpc crashes when using tagof
Reply With Quote #3

amxxpc crashes? what?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-06-2017 , 15:38   Re: amxxpc crashes when using tagof
Reply With Quote #4

The compiler crash when using if( tagType == tagof(Int )
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.
SpawnerF is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-06-2017 , 15:45   Re: amxxpc crashes when using tagof
Reply With Quote #5

Don't try to imitate C#, Java or whatever language it is. That dot notation doesn't work in Pawn, your code has many more problems than just tagof. And integers aren't tagget with Int and strings aren't tagged with String.

Last edited by klippy; 07-06-2017 at 15:46.
klippy is offline
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-06-2017 , 15:50   Re: amxxpc crashes when using tagof
Reply With Quote #6

Quote:
Originally Posted by KliPPy View Post
Don't try to imitate C#, Java or whatever language it is. That dot notation doesn't work in Pawn, your code has many more problems than just tagof. And integers aren't tagget with Int and strings aren't tagged with String.
I'm not trying to do that, I just like it that way.

I'm using this

Code:
#define ArrayList. __ArrayList__

String: and Int: Is just to make the difference, I didn't found a way to override a function so I used this way ...
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.
SpawnerF is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-06-2017 , 16:02   Re: amxxpc crashes when using tagof
Reply With Quote #7

Unless you tag a symbol yourself, that symbol's tag is _:. There's no difference between integer arrays and strings and you can't override that way. Just use separate functions named accordingly, don't override. Pawn is like C in many aspects (it was called Small C at first).
klippy is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 07-06-2017 , 19:38   Re: amxxpc crashes when using tagof
Reply With Quote #8

Use amxx 1.8.3 compiler.
Or use hack like this:
Code:
static Int:int; #pragma unused int ... if (tagType == tagof(int))

Hehe, this is interesting idea! We can make safe set_pev now.
__________________

Last edited by PRoSToTeM@; 07-06-2017 at 19:48.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
SpawnerF
Member
Join Date: Apr 2017
Location: Morocco
Old 07-07-2017 , 09:15   Re: amxxpc crashes when using tagof
Reply With Quote #9

Quote:
Originally Posted by PRoSToTeM@ View Post
...
Thank's a lot!
__________________
XX was created just for giving evidence and not meant to damage public servers.
&We do not test on public servers.
Thank's.
SpawnerF 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 19:16.


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