Problem rank
#4

Why do not the ranks want to load?
Code:
CMD:loadallrank(playerid, params[])
{
    if(PlayerInfo[playerid][Wlasciciel] == 0) return 1;
    SendClientMessage(playerid, -1, "Loading ranks.");

    LoadAllRank();

    new str[32];
    for(new id = 1; id < MAX_FRAC; id++)
    {
        if(strlen(FractionNames[id]) > 1)
        {
            format(str, 32, "%s", FractionNames[id]);
            SendClientMessage(playerid, -1, str);
            for(new i = 0; i < MAX_RANG; i++)
            {
                if(strlen(FracRang[id][i]) > 1)
                {
                    SendClientMessage(playerid, -1, FracRang[id][i]);
                }
            }
        }
    }
    SendClientMessage(playerid, -1, "OK");
    return 1;
}

forward LoadAllRank();
public LoadAllRank()
{
	new query[1500];
	mysql_format(g_SQL, query, sizeof(query), "SELECT * FROM `namerank`");
	mysql_tquery(g_SQL, query, "LoadRank");
	return 1;
}

forward LoadRank();
public LoadRank()
{
	new id, type, ranks[256];

	new results = cache_num_rows();
	if(results > 0)
	{
		for(new i = 0; i < results; i++)
		{
			cache_get_value_int(i, "ID", id);
			cache_get_value_int(i, "type", type);
			cache_get_value_name(i, "ranks", ranks, MAX_RANG_LEN);
		}
		print("Ranks were read");
	}
	else
	{

	}
	return 1;
}
In the database I have this saved
ID: 1
ranks: -, -, -, -, -, -, Chief,
type: 1
Reply


Messages In This Thread
Problem rank - by KamilPolska - 01.04.2019, 15:46
Re: Problem rank - by YenTy - 02.04.2019, 12:07
Re: Problem rank - by KamilPolska - 02.04.2019, 17:00
Re: Problem rank - by KamilPolska - 02.04.2019, 18:25
Re: Problem rank - by YenTy - 02.04.2019, 18:48
Re: Problem rank - by KamilPolska - 02.04.2019, 19:21
Re: Problem rank - by KamilPolska - 02.04.2019, 21:12
Re: Problem rank - by YenTy - 02.04.2019, 21:41
Re: Problem rank - by KamilPolska - 02.04.2019, 22:56
Re: Problem rank - by KamilPolska - 03.04.2019, 16:46
Re: Problem rank - by Logic_ - 03.04.2019, 18:04
Re: Problem rank - by KamilPolska - 03.04.2019, 18:36
Re: Problem rank - by KamilPolska - 04.04.2019, 14:46
Re: Problem rank - by KamilPolska - 04.04.2019, 18:10
Re: Problem rank - by Logic_ - 04.04.2019, 18:43
Re: Problem rank - by KamilPolska - 05.04.2019, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)