12.06.2018, 04:07
PHP код:
GangJoinSetup(playerid, action[])
{
new bool:found, string[256];
new gangid = strval(action);
foreach(new i : Gangs)
{
if(i == gangid) found = true;
else found = false;
}
if(found == false) return SendClientMessage(playerid, -1, "Gang ID not found !");
else if(found == true)
{
foreach(Player, i)
{
if(pInfo[i][pGangID] == gangid)
{
if(pInfo[i][pGangRank] >= 3)
{
SendClientMessage(playerid, -1, "Request sent.");
gJoinRequest[playerid] = gangid;
}
}
}
return 1;
}
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 i : Gangs)
{
format(string, sizeof string, "(ID: %d) %s - SCORE: %d\n", Gang[i][gID], Gang[i][gName], Gang[i][gScore]);
SendClientMessage(playerid, -1, string);
}
}
else
{
SendClientMessage(playerid, -1, "There is no gang !");
}
cache_delete(result);
SendClientMessage(playerid, -1, "-----------");
return 1;
}