Jump to content

Recommended Posts

Salut! Acum ceva timp a aparut o problema cu comanda /setleader . Mai exact, cand dau setleader cuiva in mafie spune ca comanda nu exista si ii seteaza rank 0 in mafia respectiva. Comanda a mers perfect, nu inteleg ce a patit. Gamemode-ul este burned original la baza. Ma poate ajuta cineva?

In comanda nu am umblat deloc, doar ce am modificat in loc de //School Instructors in SFPD unde pune skin-ul.

Poze: https://imgur.com/a/A1sYTrO

Comanda: https://pastebin.com/Ukzz0HwK

Video: 

 

Edited by The_RobyRo
Link to post
Share on other sites
CMD:setleader(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_WHITE, AdminOnly);
    new id,level,string[180];
    if(sscanf(params, "ui",id,level)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setleader <playerid/name> <faction>");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(level > 15 || level < 0) return SCM(playerid, COLOR_WHITE, "Invalid ID. (1-15).");
    
    if(PlayerInfo[id][pMember] > 0 && PlayerInfo[id][pLeader] > 0) return SCM(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] = 265; } //SFPD
    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]);    
    PlayerTextDrawSetPreviewModel(playerid, SkinPreview[ playerid ], GetPlayerSkin(playerid));
    PlayerTextDrawShow(playerid, SkinPreview[ playerid ]);    
    PlayerInfo[id][pRank] = 7;
    SetPlayerToTeamColor(id);

    new query[300];
    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);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    
    format(string, sizeof(string), "Admin %s te-a promovat ca lider al factiunii %s.", GetName(playerid),ftext);
    SCM(id, COLOR_LIGHTBLUE, string);
    return 1;
}

Incearca si vezi daca merge.

Link to post
Share on other sites
Acum 8 ore, BaFFyJunior a spus:
CMD:setleader(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 4) return SCM(playerid, COLOR_WHITE, AdminOnly);
    new id,level,string[180];
    if(sscanf(params, "ui",id,level)) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/setleader <playerid/name> <faction>");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SCM(playerid, COLOR_GREY, "Acel player nu este conectat.");
    if(level > 15 || level < 0) return SCM(playerid, COLOR_WHITE, "Invalid ID. (1-15).");
    
    if(PlayerInfo[id][pMember] > 0 && PlayerInfo[id][pLeader] > 0) return SCM(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] = 265; } //SFPD
    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]);    
    PlayerTextDrawSetPreviewModel(playerid, SkinPreview[ playerid ], GetPlayerSkin(playerid));
    PlayerTextDrawShow(playerid, SkinPreview[ playerid ]);    
    PlayerInfo[id][pRank] = 7;
    SetPlayerToTeamColor(id);

    new query[300];
    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);
    SCM(playerid, COLOR_LIGHTBLUE, string);
    
    format(string, sizeof(string), "Admin %s te-a promovat ca lider al factiunii %s.", GetName(playerid),ftext);
    SCM(id, COLOR_LIGHTBLUE, string);
    return 1;
}

Incearca si vezi daca merge.

Nup, nu merge. E alta problema care habar nu am de unde provine. Prin schimbarea SCM cu SendClientMessage nu prea se schimba nimic, iar textdraw-urile alea nu prea isi au locul acolo deoarece oricum nu am textdraw-urile in sine. Mersi oricum de ajutor.

Link to post
Share on other sites
  • 2 months later...
La 18.10.2019 la 15:46, [El.Capo] a spus:

Incearca sa refaci comanda.

Revin cu reply dupa mult mult timp :) 

Am refacut comanda si efectiv nu-i dau de cap.

Am redeschis un topic, poate poate se gaseste o rezolvare :) 

Cel mai probabil altceva creeaza problema.

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.