Jump to content

You have reached maximum members.


xCosminu.

Recommended Posts

spune mi ce sa ti dau

uite

 

CMD:cinvite(playerid, params[])
{
    if(PlayerInfo[playerid][pCRank] < 6) return SendClientMessage(playerid, COLOR_WHITE, "Doar playerii cu rank 6 si 7 pot invita membri in clan.");
    new userID,giveplayer[25],sendername[25],szMessage[119];
    if(sscanf(params, "u", userID)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cinvite [id]");
    {
        if(GetClanMembers(PlayerInfo[playerid][pClan]) >= ClanInfo[PlayerInfo[playerid][pClan]][cClanSlots]) return SendClientMessage(playerid, COLOR_WHITE, "You have reached maximum members.");
        if(userID == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti sa te inviti singur in clan.");
        if(ClanInfo[PlayerInfo[playerid][pClan]][cClanActive] < 0) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti invita membri deoarece clanul a expirat (pentru prelungire intra pe panel).");
        if(IsPlayerConnected(userID))
        {
            if(PlayerInfo[userID][pClan] == 1)
            {
                GetPlayerName(userID,giveplayer,sizeof(giveplayer));
                format(szMessage, sizeof(szMessage), "You have invited %s to join your clan.", giveplayer);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage);

                GetPlayerName(playerid,sendername,sizeof(sendername));
                format(szMessage, sizeof(szMessage), "%s te-a invitat in clanul %s. Foloseste /accept cinvite %d pentru a accepta.", sendername, ClanInfo[PlayerInfo[playerid][pClan]][cClanName], playerid);
                SendClientMessage(userID, COLOR_BLUE, "Invitatie noua in clan:");
                SendClientMessage(userID, COLOR_BLUE, szMessage);

                SetPVarInt(userID, "cinvID", PlayerInfo[playerid][pClan]);
                SetPVarInt(userID, "cinvIDD", playerid);
            }
        }
    }
    return 1;
}

 

 

stock GetClanMembers(clanid)
{
    new string[256],
        members=15;
    format(string, sizeof(string), "SELECT * FROM `users` WHERE `Clan` = '%d'", clanid);
    new Cache: membresult = mysql_query(SQL, string);
    for(new i, j = cache_get_row_count (); i != j; ++i)
    {
        members++;
    }
    cache_delete(membresult);
    return members;
}

 

 

 

if(listitem == 6)
                {
                    new i,stringyy[500];
                    if(PlayerInfo[playerid][pPremiumPoints] >= 5000)
                    {
                        if(PlayerInfo[playerid][pClan] == 0)
                        {
                            PlayerInfo[playerid][pPremiumPoints] -= 5000;
                            Update(playerid, pPremiumPointsx);
                            format(stringyy, sizeof(stringyy), "You have bought a clan! (-5000 premium points)");
                            SendClientMessage(playerid, COLOR_YELLOW, stringyy);
                            PlayerInfo[playerid][pCRank] = 7;

                        //    mysql_format(SQL, safeString, sizeof(safeString), "INSERT INTO clans (clanName) VALUES('New Clan')");
                        //    mysql_tquery(SQL,safeString,"","");
                        //    i = mysql_insert_id();
                            //========
                            new Cache: resultoccc = mysql_query(SQL,  "INSERT INTO `clans` (`clanName`) VALUES('New Clan')");

                            i = cache_insert_id();
                            cache_delete(resultoccc);
                            
                            ClanInfo[cClanExpire] = gettime() + (90*86400);
                            ClanInfo[cClanSlots] = 15;
                            ClanInfo[cClanActive] = 1;

                            PlayerInfo[playerid][pClan] = i;
                            
                            mysql_format(SQL, stringyy, sizeof(stringyy), "UPDATE `clans` SET `clanExpire`='%d' WHERE `clanID`='%d'",ClanInfo[cClanExpire],i);
                            mysql_tquery(SQL, stringyy, "", "");

                            new y,m,d,h,mi,s;
                            getdate(y,m,d);
                            gettime(h,mi,s);
                            mysql_format(SQL, stringyy, sizeof(stringyy), "UPDATE users SET `CRank`='7',`Clan`='%d',`PremiumPoints`='%d',`ClanJoin`='%02d-%02d-%d %02d:%02d:%02d' WHERE `name`='%s'", PlayerInfo[playerid][pClan], PlayerInfo[playerid][pPremiumPoints],d,m,y,h,mi,s,PlayerInfo[playerid][pNormalName]);
                            mysql_tquery(SQL,stringyy,"","");
                            
                            new strings[200],name[30],stringss[200],str[300];
                            GetPlayerName(playerid, name, sizeof(name));
                            format(strings, sizeof(strings), "/shop: %s created a new clan.",name);
                            ABroadCast(COLOR_YELLOW,strings,6);
                            mysql_real_escape_string(strings, stringss);
                            mysql_format(SQL,str,sizeof(str), "INSERT INTO `shop_logs` (`playerid`,`Message`) VALUES('%d','%s')",PlayerInfo[playerid][pSQLID],stringss);
                            mysql_tquery(SQL,str,"","");
                            ShowPlayerDialog(playerid, DIALOG_CHOOSECLANNAME, DIALOG_STYLE_INPUT, "Clan name", "Insert clan name in the box below:\n(You can't change it after that!)", "Ok", "");

                        }
                        else return SCM(playerid,COLOR_WHITE,"You already are in a clan! Use /quitclan first.");
                    }
                    else return ShowPlayerDialog(playerid, DIALOG_NOPP, DIALOG_STYLE_MSGBOX, "Not enough points", "You don't have enough premium points to do this.", "Close", "");
                }

Edited by xCosminu.
Link to comment
Share on other sites

Acum 18 ore, AlexxAdv a spus:

Dai clear la clans in baza de date, deoarece folosesti gm stil bigzone si id-urile de la clan nu incep de la 0 in .sql! dai clear si o sa mearga.

 

pentru a face ce a spus el, @xCosminu. fa asa

intri in baza apesi pe clans, apoi sus dreapta pe Operations, apoi dai pagina in jos si apesi pe Empty the table. sa nu apesi pe drop, pentru ca o sa se stearga tot tabelul. apesi pe empty

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.