SA-MP Forums Archive
Command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help (/showthread.php?tid=552309)



Command help - Sanady - 23.12.2014

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.
pawn Код:
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;
}



Re: Command help - Sanady - 23.12.2014

Anyone? Sorry for double posting


Re: Command help - Sanady - 25.12.2014

Anyone can help me with this?