foreach problem or somthing
#1

PHP код:
GangJoinSetup(playeridaction[])
{
    new 
bool:foundstring[256];
    new 
gangid strval(action);
    foreach(new 
Gangs)
    {
        if(
== gangidfound true;
        else 
found false;
    }
    
    if(
found == false) return SendClientMessage(playerid, -1"Gang ID not found !");
    else if(
found == true)
    {
        foreach(
Playeri)
        {
            if(
pInfo[i][pGangID] == gangid)
            {
                if(
pInfo[i][pGangRank] >= 3)
                {
            
SendClientMessage(playerid, -1"Request sent.");
            
gJoinRequest[playerid] = gangid;
                }
        }
    }
    return 
1;

i don't know why its show me Gang ID not found and everything loaded succesfully and its working when i do ganglist


exemple when i do /gjoin id its show GANG ID not Found and when i do /glist it show me all gang in it

CODE of GANG LIST:
PHP код:
GangListSetup(playerid)
{
    new 
string[256];
    new 
Cache:result mysql_query(g_SQL"SELECT * FROM `gangs`");
    new 
rows cache_num_rows();
    
SendClientMessage(playerid, -1"GANG LIST");
    if(
rows != 0)
    {
        foreach(new 
Gangs)
        {
            
format(stringsizeof string"(ID: %d)  %s - SCORE: %d\n"Gang[i][gID], Gang[i][gName], Gang[i][gScore]);
            
SendClientMessage(playerid, -1string);
        }
    }
    else
    {
        
SendClientMessage(playerid, -1"There is no gang !");
    }
    
cache_delete(result);
    
SendClientMessage(playerid, -1"-----------");
    return 
1;

Reply


Messages In This Thread
foreach problem or somthing - by LevelT - 12.06.2018, 04:07
Re: foreach problem or somthing - by Dayrion - 12.06.2018, 10:33
Re: foreach problem or somthing - by Calisthenics - 12.06.2018, 10:45
Re: foreach problem or somthing - by poppingrose - 12.06.2018, 14:22

Forum Jump:


Users browsing this thread: 1 Guest(s)