Jump to content

Problema clan chat


Two

Recommended Posts

Salut.

Dupa ce imi creez sau intru intr-un clan, si incerc sa scriu ceva pe  /c, imi zice unknown command, iar daca scriu simplu /c, imi zice normal "/c  [clan chat]"

Nu inteleg unde este problema, las mai joc comanda /c. Multumesc anticipat.

CMD:c(playerid, params [])
{
    if(pInfo[playerid][pMute] > 0) return SendClientMessage(playerid, COLOR_DARKGRAY, "You cannot speak, you have been muted.");
    if(pInfo[playerid][pClan] == -1) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not part of a clan.");
    if(sscanf(params, "s[128]", params)) return SendSyntaxMessage(playerid, "/c [clan chat]");
    switch(pInfo[playerid][pCRank])
    {
        case 7: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank7], GetName(playerid), params);
        case 6: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank6], GetName(playerid), params);
        case 5: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank5], GetName(playerid), params);
        case 4: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank4], GetName(playerid), params);
        case 3: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank3], GetName(playerid), params);
        case 2: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank2], GetName(playerid), params);
        case 1: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank1], GetName(playerid), params);
        default: format(stmsg[playerid], 169, "{%s}Asociate %s: %s", Clan[pInfo[playerid][pClan]], GetName(playerid), params);
    }
    SendClanMessage(pInfo[playerid][pClan], -1, stmsg[playerid]);
    return 1;
}

Edited by Two
Link to comment
Share on other sites

//Gresit
if(sscanf(params, "s[128]", params)) return SendSyntaxMessage(playerid, "/c [clan chat]");

//Corect ar fi
new text[128];
if(sscanf(params, "s[128]", text)) return SendSyntaxMessage(playerid, "/c [clan chat]");


Prin urmare comanda corecta ar fi:

CMD:c(playerid, params []) {

    if(pInfo[playerid][pMute] > 0) return SendClientMessage(playerid, COLOR_DARKGRAY, "You cannot speak, you have been muted.");
    if(pInfo[playerid][pClan] == -1) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not part of a clan.");

    new text[128];
    if(sscanf(params, "s[128]", text)) return SendSyntaxMessage(playerid, "/c [clan chat]");
    switch(pInfo[playerid][pCRank]) {
        case 7: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank7], GetName(playerid), text);
        case 6: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank6], GetName(playerid), text);
        case 5: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank5], GetName(playerid), text);
        case 4: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank4], GetName(playerid), text);
        case 3: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank3], GetName(playerid), text);
        case 2: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank2], GetName(playerid), text);
        case 1: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank1], GetName(playerid), text);
        default: format(stmsg[playerid], 169, "{%s}Asociate %s: %s", Clan[pInfo[playerid][pClan]], GetName(playerid), text);
    }
    SendClanMessage(pInfo[playerid][pClan], -1, stmsg[playerid]);
    return 1;
}

Edited by GenjiiAdv
Link to comment
Share on other sites

Acum 42 minute, GenjiiAdv a spus:

//Gresit
if(sscanf(params, "s[128]", params)) return SendSyntaxMessage(playerid, "/c [clan chat]");

//Corect ar fi
new text[128];
if(sscanf(params, "s[128]", text)) return SendSyntaxMessage(playerid, "/c [clan chat]");


Prin urmare comanda corecta ar fi:

CMD:c(playerid, params []) {

    if(pInfo[playerid][pMute] > 0) return SendClientMessage(playerid, COLOR_DARKGRAY, "You cannot speak, you have been muted.");
    if(pInfo[playerid][pClan] == -1) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not part of a clan.");

    new text[128];
    if(sscanf(params, "s[128]", text)) return SendSyntaxMessage(playerid, "/c [clan chat]");
    switch(pInfo[playerid][pCRank]) {
        case 7: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank7], GetName(playerid), text);
        case 6: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank6], GetName(playerid), text);
        case 5: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank5], GetName(playerid), text);
        case 4: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank4], GetName(playerid), text);
        case 3: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank3], GetName(playerid), text);
        case 2: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank2], GetName(playerid), text);
        case 1: format(stmsg[playerid], 169, "{%s}(%d) %s %s: %s", Clan[pInfo[playerid][pClan]], pInfo[playerid][pCRank], Clan[pInfo[playerid][pClan]][Rank1], GetName(playerid), text);
        default: format(stmsg[playerid], 169, "{%s}Asociate %s: %s", Clan[pInfo[playerid][pClan]], GetName(playerid), text);
    }
    SendClanMessage(pInfo[playerid][pClan], -1, stmsg[playerid]);
    return 1;
}

Am pus comanda ta, si e aceeasi problema.. ai nevoie si de alt ceva?

Edited by Two
Link to comment
Share on other sites

Acum 17 minute, Two a spus:

Am pus comanda ta, si e aceeasi problema.. ai nevoie si de alt ceva?

Pai ai putea sa imi dai partea unde intrii intr-un clan / creezi un clan.

Edited by GenjiiAdv
Link to comment
Share on other sites

Acum 21 minute, Two a spus:

Am pus comanda ta, si e aceeasi problema.. ai nevoie si de alt ceva?

As mai avea o idee, 

Clan[pInfo[playerid][pClan]] nu imi sugereaza ceva gandit bine, cred ca ai vrut sa pui Clan[pInfo[playerid][pClan]][cColor] sau cum ai tu.

 

Edited by GenjiiAdv
Link to comment
Share on other sites

Rezolvat, puteti da T/C.

REZOLVARE : 

GenjiiAdv a creeat o comanda corecta : 

CMD:c(playerid, params[]) {
    if(pInfo[playerid][pMute] > 0) return SendClientMessage(playerid, COLOR_DARKGRAY, "You cannot speak, you have been muted.");
    if(pInfo[playerid][pClan] == -1) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not part of a clan.");
    new text[128], playerclan = pInfo[playerid][pClan], tmpstring[128 + 50];
    if(sscanf(params, "s[128]", text)) return SendSyntaxMessage(playerid, "/c [clan chat]");
    switch(pInfo[playerid][pCRank]) {
        case 0: format(tmpstring, 15, "None");
        case 1: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank1], GetName(playerid), text);
        case 2: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank2], GetName(playerid), text);
        case 3: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank3], GetName(playerid), text);
        case 4: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank4], GetName(playerid), text);
        case 5: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank5], GetName(playerid), text);
        case 6: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank6], GetName(playerid), text);
        case 7: format(tmpstring, 128 + 50, "{%s}(%d) %s %s: %s", Clan[playerclan][Color], pInfo[playerid][pCRank], Clan[playerclan][Rank7], GetName(playerid), text);
    }
    foreach(new pl : Player) {
        if(pInfo[pl][pClan] == playerclan) SendClientMessage(playerid, COLOR_WHITE, tmpstring);
    }
    return 1;
}

 

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.