Jump to content

Problema comanda /setleader


Recommended Posts

Salut, nu reusesc nici cum sa gasesc o rezolvare pentru problema asta. Am incercat sa rescriu comanda, dar ceva imi spune ca nu de la comanda se trage aceasta problema.

Comanda /setleader merge la orice factiune inafara de mafii. Daca pun spre exemplu /setleader id 4 (id groove) imi spune comanda inexistenta. (Comanda are return 1; la sfarsit)

Gamemode-ul este Burned default la baza. Vreo idee ?

Comanda: 

CMD:setleader(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
    new id,level,string[180];
    if(sscanf(params, "ui",id,level)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setleader <playerid/name> <faction>");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(level > 15 || level < 0) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID. (1-15).");
    
    if(PlayerInfo[id][pMember] > 0 && PlayerInfo[id][pLeader] > 0) return SendClientMessage(playerid,COLOR_WHITE, "Acel player este intr-o factiune.");
    format(string, sizeof(string), "%s este noul lider al factiunii.", GetName(id));
    SendFactionMessage(level, COLOR_CLIENT, string);
    
    new ftext[50];
    format(ftext, sizeof(ftext), FactionName(level));
    PlayerInfo[id][pMember] = level;
    
    if(PlayerInfo[playerid][pMember] == 11) finishAchievement(id, 29);    
    else if(IsACop(playerid)) finishAchievement(id, 30);    
    else if(IsAMember(playerid)) finishAchievement(id, 31);    
    else finishAchievement(id, 28);    
    
    
    PlayerInfo[id][pLeader] = level;
    FactionMembers[PlayerInfo[id][pMember]] ++;
    if(level == 0) { PlayerInfo[id][pChar] = 0; }
    else if(level == 1) { PlayerInfo[id][pChar] = 265; } //Police Departament
    else if(level == 2) { PlayerInfo[id][pChar] = 295; } //FBI
    else if(level == 3) { PlayerInfo[id][pChar] = 179; } //National Guard
    else if(level == 4) { PlayerInfo[id][pChar] = 270; } //Triad
    else if(level == 5) { PlayerInfo[id][pChar] = 292; } //Los Vagos
    else if(level == 6) { PlayerInfo[id][pChar] = 273; } //Ballas
    else if(level == 7) { PlayerInfo[id][pChar] = 258; } //School Instructors
    else if(level == 8) { PlayerInfo[id][pChar] = 59; } //Tow Car Company
    else if(level == 9) { PlayerInfo[id][pChar] = 228; } //News Reporters
    else if(level == 10) { PlayerInfo[id][pChar] = 296; } //Los Aztecas
    else if(level == 11) { PlayerInfo[id][pChar] = 294; } //Hitman
    else if(level == 12) { PlayerInfo[id][pChar] = 272; } //School Instructors
    else if(level == 13) { PlayerInfo[id][pChar] = 70; } //Paramedic

    if(IsACop(id)) SetPlayerSkinEx(id, 305);
    else SetPlayerSkinEx(id, PlayerInfo[id][pChar]);                    
    PlayerInfo[id][pRank] = 7;
    SetPlayerToTeamColor(id);

    new query[256];
    format(string, sizeof(string), "%s este liderul factiunii %s.", GetName(id), ftext);
    
    if(PlayerInfo[id][pAdmin] < 6) {
        mysql_format(SQL, query, sizeof(query), "INSERT INTO faction_logs (`text`, `player`,`leader`) VALUES ('%s','%d','%d')", string, PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID]);
        mysql_tquery(SQL,query,"","");            
    }
    
    format(query,sizeof(query),"UPDATE users SET `Leader`='%d',`Member`='%d',`Rank`='7',`Team`='%d',`CChar`='%d' WHERE `ID`='%d'",PlayerInfo[id][pLeader],PlayerInfo[id][pMember],PlayerInfo[id][pTeam],PlayerInfo[id][pChar],PlayerInfo[id][pSQLID]);
    mysql_query(SQL,query);    
    format(string, sizeof(string), "L-ai promovat pe %s ca lider la factiunea %s.", GetName(id),ftext);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);    
    
    format(string, sizeof(string), "Admin %s te-a promovat ca lider al factiunii %s.", GetName(playerid),ftext);
    SendClientMessage(id, COLOR_LIGHTBLUE, string);        
    return 1;
}

Link to post
Share on other sites

probabil mafiile au id-uri diferite de pchar fata de ce are gm burned, cauta id urile prin gm si le pui la fiecare mafie, dar tot iti recomand sa rescrii in totalitate comanda , deoarece pot exista bug uri

Link to post
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.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.