Jump to content

Recommended Posts

Posted

Ma poate ajuta cineva....deci am sters getclanmembers, am si modificat, am incercat si din comanda cinvite...nu stiu, si mereu imi spune cand vreau sa dau cinvite "You have reached maximum members."Ma poate ajuta cineva?

 

Posted (edited)

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.
Posted

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.

Posted
Chiar acum, AlexxAdv a spus:

Daca nici atat lucru nu stii, las-o balta.

pai mane...eu nu prea am avut cu baza de date treaba..numa daca imi poti spune, daca nu aia e

 

Posted
Acum 1 oră, AlexxAdv a spus:

Iar in stock-ul  de getclanmembers, members trebuie sa fie egal cu 0 nu cu 15.

problema persista, am sters clans si am modificat la getclan cu 0, tot asa zicce.

 

Posted
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

 

 

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.