Jump to content

Problema comanda /status pentru leader


Recommended Posts

Tin sa mentionez ca acest server la coamnda /factions unde apar lideri aparea si statusul pentru aplicatie daca se poate aplica closed sau open si o pot modifica doar din mysql nu am comanda am incercat sa fac unu sa modific din joc dar nu reusesc ce am gresit 

 

CMD:status(playerid, params [])
{
    if(pInfo[playerid][pRank] < 6 || pInfo[playerid][pMember] == 13) return SendClientMessage(playerid, COLOR_DARKGRAY, "You not have minimum rank 6.");
    new motd[90];
    if(sscanf(params, "s[90]", motd)) return SendClientMessage(playerid, 0x8EC7DCFF, "Syntax: {FFFFFF}/status [MOTD Text]");
    if(strlen(motd) > 89) return SendClientMessage(playerid, COLOR_DARKGRAY, "Maximum characters allowed for status is 90.");
    if(!IsValidMOTD(motd)) return SendClientMessage(playerid, COLOR_DARKGRAY, "Invalid characters, valid characters are: A-Z, a-z, 0-9, (. , : ! ?).");
    mysql_tquery(MySQLCon, "SELECT option_value FROM `inf_options` WHERE `option_name`='factionAppStatus1' OR `option_name`='factionAppStatus2' OR `option_name`='factionAppStatus3' OR `option_name`='factionAppStatus4'OR `option_name`='factionAppStatus5'OR `option_name`='factionAppStatus6'OR `option_name`='factionAppStatus7'OR `option_name`='factionAppStatus8'OR `option_name`='factionAppStatus9'OR `option_name`='factionAppStatus10'OR `option_name`='factionAppStatus11'OR `option_name`='factionAppStatus12'OR `option_name`='factionAppStatus14'OR `option_name`='factionAppStatus15'OR `option_name`='factionAppStatus16'OR `option_name`='factionAppStatus17'OR `option_name`='factionAppStatus18'OR `option_name`='factionAppStatus19'", "OnFUP", "");
    format(stringf[pInfo[playerid][pMember]-1], 100, "Faction MOTD: {FFFFFF}%s", motd), SendClientMessage(playerid, 0xA9C4E4FF, stringf[pInfo[playerid][pMember]-1]);
    return 1;
}

daca scriam 0 trebuia sa se modifice in baza de date si sa nu mai poti aplica si daca pui 1 sa poti aplica!

 

Discord: BaDB0y#3017

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

CMD:status(playerid, params[])

{

    if (pInfo[playerid][pRank] < 6 || pInfo[playerid][pMember] == 13)

    {

        return SendClientMessage(playerid, COLOR_DARKGRAY, "You do not have the minimum rank of 6.");

    }

 

    new motd[90];

 

    if (sscanf(params, "s[90]", motd))

    {

        return SendClientMessage(playerid, 0x8EC7DCFF, "Syntax: {FFFFFF}/status [MOTD Text]");

    }

 

    if (strlen(motd) > 90)

    {

        return SendClientMessage(playerid, COLOR_DARKGRAY, "Maximum characters allowed for status is 90.");

    }

 

    if (!IsValidMOTD(motd))

    {

        return SendClientMessage(playerid, COLOR_DARKGRAY, "Invalid characters, valid characters are: A-Z, a-z, 0-9, (. , : ! ?).");

    }

 

    new query[200];

    mysql_format(query, sizeof(query), "UPDATE inf_options SET option_value = '%s' WHERE option_name = 'factionAppStatus%d'",

                 motd, pInfo[playerid][pMember]);

    mysql_tquery(MySQLCon, query, "OnFUP", "");

 

    format(stringf[pInfo[playerid][pMember] - 1], 100, "Faction MOTD: {FFFFFF}%s", motd);

    SendClientMessage(playerid, 0xA9C4E4FF, stringf[pInfo[playerid][pMember] - 1]);

 

    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.