Raised This Month: $ Target: $400
 0% 

ArrayFindString


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 05-27-2019 , 12:27   ArrayFindString
Reply With Quote #1

It doesn't work or am I doing something wrong?
I get -1 even tho Array String is filled with user's name and I'm searching using same variable.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "PLUGIN"
#define VERSION "1.0.0"
#define AUTHOR "AUTHOR"

enum _:MarketData
{
    
RowId,
    
Seller[32],
    
SkinId,
    
CaseId,
    
KeyId,
    
Quantity,
    
Float:Price
}


new Array:
g_aArray;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say test""testout");

    
g_aArray ArrayCreate(MarketData);
}

public 
testout(id) {
    new 
Data[MarketData];

    new 
szName[32];
    
get_user_name(idszNamecharsmax(szName));

    for (new 
i5i++)
    {
        
Data[RowId] = i;
        
copy(Data[Seller], charsmax(Data[Seller]), szName);
        
Data[SkinId] = random_num(159);
        
Data[CaseId] = random_num(159);
        
Data[KeyId] = random_num(159);
        
Data[Quantity] = random_num(159);
        
Data[Price] = random_float(1.059.0);
        
ArrayPushArray(g_aArrayData);
    }

    new 
ItemExists ArrayFindString(g_aArrayszName);
    
client_print_color(idprint_team_default"%d"ItemExists);

__________________

Last edited by Airkish; 05-27-2019 at 12:32.
Airkish is offline
 



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 08:51.


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