PDA

View Full Version : Command help


Sanady
23/12/2014, 06:42 PM
Hello everybody. I made a new command which is checking stats of your squad. It`s displaying leader, name of squad and members of squad. Well my problem is when I am in game and when I type checkyoursquad, members are always 4 but when friend of mine has joined it`s showing me 28 member. In my database it`s showing 11 members. I don`t see any problem but code see. Please take a look and tell me.

CMD:checkyoursquad(playerid, params[])
{
new squadid = GetPlayerUniqueSquadID(playerid);
if(pInfo[playerid][pSquadID] == 0) return SendClientMessage(playerid, -1,""embed_red"[Error] "embed_white"You are not in a squad !");

mysql_query("SELECT * FROM `users` WHERE `SquadID` = '%d'",pInfo[playerid][pSquadID]);
mysql_store_result();
new count = mysql_field_count();
format(slova, sizeof(slova),"SELECT * FROM `users` WHERE `ID` = '%d' AND `UserName` = '%s'",sInfo[squadid][SquadLeader],pName[playerid]);
mysql_query(slova);

SendClientMessage(playerid,-1,"{BCF562}========================================== ========");
format(slova,sizeof(slova),"{FFFFFF}Squad Name: {BCF562}%s",sInfo[squadid][SquadName]);
SendClientMessage(playerid,-1,slova);
format(slova,sizeof(slova),"{FFFFFF}Squad Members: {BCF562}%d/12", count);
SendClientMessage(playerid,-1,slova);
format(slova,sizeof(slova),"{FFFFFF}Squad Leader: {BCF562}%s %s", pName[playerid], IsPlayerConnected(playerid) ? (embed_green"[Online]") : (embed_red"[Offline]"));
SendClientMessage(playerid,-1,slova);
SendClientMessage(playerid,-1,"{FFFFFF}If you want see your members type /squadmembers");
SendClientMessage(playerid,-1,"{BCF562}========================================== ========");
mysql_free_result();
return 1;
}

Sanady
23/12/2014, 08:39 PM
Anyone? Sorry for double posting

Sanady
25/12/2014, 08:43 AM
Anyone can help me with this?