Jump to content
  • 0

Problema clans


iulian24

Question

Deci , problema este ca atunci cand creez un clan, si sunt lider, in clan fiind doar eu ,  si incerc sa dau /cinvite cuiva , zice "you have reached maximum members"

Poze: sloturi : cLPeZ4y.png

 

conditia la conectare db : 8z6uF6Q.png

 

 

codul comenzii /cinvite in sine :

 

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] < 1) return SendClientMessage(playerid, COLOR_WHITE, "Nu poti invita membri deoarece clanul a expirat (pentru prelungire poti intra pe forum).");
        if(IsPlayerConnected(userID))
        {
            if(PlayerInfo[userID][pClan] == 0)
            {
                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;
}

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Aici cumperi clan-ul din /shop , al 5-lea din lista si tot odata il si creezi :

 

if(listitem == 5)
                {
                    new i,stringyy[500];
                    if(PlayerInfo[playerid][pPremiumPoints] >= 100)
                    {
                        if(PlayerInfo[playerid][pClan] == 0)
                        {
                            PlayerInfo[playerid][pPremiumPoints] -= 100;
                            format(stringyy, sizeof(stringyy), "You have bought a clan! (-100 emeralds)");
                            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);

                            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 emeralds to do this.", "Close", "");
                }

 

iar aici e functia getclanmembers

ZJoAYHy.png

 

Oricine ar avea o rezolvare exacta , lasa-ti va rog un reply ca eu nu am reusit sa ii dau de cap si nu pot lasa serverul asa , va multumesc frumos din suflet!

Sarbatori fericite!

Link to comment
Share on other sites

  • 0

Adauga la acel dialog in listitem pe unde se seteaza variabilele

 

ClanInfo [ i ] [ cClanSlots] = 15;

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Asta ar impune tuturor clanurilor sa aiba slots = 15. Initial am vrut sa le pot seta sloturile din baza de date si acel cClanSlots sa citeasca variabila din mysql. o sa incerc totusi cum ai spus tu sa incerc daca merge macar asa.

 

 

EDIT: Am incercat acolo unde se salveaza la  ClanInfo [ i ] [ cClanSlots] , nu mai citea nr de slot-uri din mysql , ci am setat eu  ClanInfo [ i ] [ cClanSlots] = 15; Eroarea persista!

Edited by iulian24
Link to comment
Share on other sites

  • 0

Inca o eroare a mai aparut pe langa aceasta. Acum nu mai apare eroare ca "You have reached maximum members" desi ea inca exista , acum imi apare "Clanul a expirat , pentru prelungire intra pe forum etc..." Desi cu 10 secunde inainte il creeasem.

 

Putin help va rog?

Link to comment
Share on other sites

  • 0

Ai butonul edit

Din moment ce nu mai primesti mesajul cu "ai atins nr de membri" insemna ca acum este setat corect slotul la 15 si acum iti da mesajul cu expirat pentru ca nu este setat bine din script, iti dadea si inainte doar ca nu ajungea pana acolo caci se oprea in eroarea cu numarul de sloturi. parerea mea este sa te uiti la un alt sistem cum este facut si sa vezi care sunt greselile

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Problema e ca eu pe serverul local am definit variabila cclanslots = 15;

Pe serverul hostat nu e , e inca conectata la slot-urile ce apar in mysql , si cu toate astea , cand dau pe serverul hostat /cinvite id nu imi mai apare ca am atins numarul maxim de membrii ci ca a expirat clanul..

Link to comment
Share on other sites

  • 0

Pe host e bine teoretic 

Mai adauga la dialogul de unde cumperi clan asta

ClanInfo [ i ] [cClanActive] = 1;

pentru ca dupa ce cumperi un clan eu vad ca ii seteaza numele tagul si toate alea dar nu vad sa ti l faca activ. iar in baza de date vad ca unul este expirat e posibil sa fie chiar al tau

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.