Raised This Month: $ Target: $400
 0% 

Compare Array Question


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 03-14-2006 , 01:18   Compare Array Question
Reply With Quote #1

hi

i have 2 arrays one called admins[32] and one called adminSQL[100]

i need to compare these arrays and cant get my head around how

admins[32] stores the steam id of any admins on the server
adminSQL[100] stores all the admin steamids from "auth" field

how would i compare these 2 arrays since SQL could have anywhere from 1 admin to 100 admins and the server could have 32 admins on it.

heres what i got so far
Code:
    new adminSteamIDs[32]     new authID[32]     new players[32], inum     new i = 0         get_players(players,inum)         //Find All Admins On Server and Store SteamID in array     while( i < inum ){         if( get_user_flags(players[i])){             get_user_authid(players[i],authID,31)             copy(adminSteamIDs[i],31,authID)         }         i++     }     //Retrieve All Admins From SQL Database and Store In Array     new steamSQL[100]     new adminName[100]     new j = 0         result = dbi_query(dbc,"SELECT auth,name FROM admins")         while( j < dbi_num_rows(result)){         dbi_nextrow(result)         dbi_result(result,"auth",steamSQL[j])     }         //Compare Admins Array With SQL Array And Print If They Match

someone help please
__________________
Dont know how to add admins?

use my program
http://www.amxmodx.org/forums/viewto...=129092#129092

it does the work for you ... sort of
Anthraxnz 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 20:16.


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