SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/08/2020, 09:12 PM   #1
xAlecsu
Big Clucker
 
Join Date: Aug 2013
Posts: 189
Reputation: 2
Default getfactionmembers and getfactionleader

Hello ,i have this warning :
PHP Code:
C:\Users\alecs\OneDrive\Desktop\sa-mp nou\gamemodes\Base.pwn(358) : warning 202number of arguments does not match definition
C
:\Users\alecs\OneDrive\Desktop\sa-mp nou\gamemodes\Base.pwn(369) : warning 202number of arguments does not match definition 
PHP Code:
Line 358 : for(new icache_get_row_count(); ji++)
Line 369: for(new icache_get_row_count (); ji++) 
PHP Code:
function GetFactionMembers(fid) {
    new 
szQuery[256], membriiCacheresult;
    
format(szQuerysizeof(szQuery), "SELECT * FROM `users` WHERE `Faction` = '%d'"fid);
    
result mysql_query(handleszQuery);
    for(new 
icache_get_row_count(); ji++){
        
membrii++;
    }
    
cache_delete(result);
    return 
membrii;
}
GetFactionLeader(fid) {
    new 
szQuery[256], szName[256], string[256], leadersCacheresult;
    
format(szQuerysizeof(szQuery), "SELECT * FROM `users` WHERE `Leader` = '%d'"fid);
    
result mysql_query(handleszQuery);
    
format(stringsizeof(string), "Fara lider.");
    for(new 
icache_get_row_count (); ji++) {
        
cache_get_field_content(0"Username"szName);
        
leaders ++;
        
format(stringsizeof(string), "%s"szName);
    }
    
cache_delete(result);
    return 
string;

Why i get this warning?...
xAlecsu is offline   Reply With Quote
Old 04/08/2020, 10:10 PM   #2
Proxus
Huge Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 463
Reputation: 20
Default Re: getfactionmembers and getfactionleader

cache_get_row_count's only parameter is a destination to store the number of rows.
For example:
Code:
new rows;
cache_get_row_count(rows);
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"


IMPORTANT LINKS
An upcoming mix of trucking & light roleplay
Proxus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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



All times are GMT. The time now is 07:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.