Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Recommended Posts

Posted

Salut , azi am incercat sa creez o comanda /sethelper

Si cand sa o execut in joc nu imi apare nimica de ce ?
           

Quote

CMD:sethelper(playerid, params[]) 
{
    if(playerVariables[playerid][pAdminLevel] >= 7)
    {
        new
            playeradmid,
            playername[60],
            level,
            string[256];

        if(sscanf(params, "s[60]i", playername,level)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/sethelper [exact player name] [level]");
        {     
            playeradmid = GetPlayerID(playername);
            if(IsPlayerConnected(playeradmid))
            {
                if(level >= 0 && level <= 3) 
                {

                    GetPlayerName(playeradmid, szPlayerName, MAX_PLAYER_NAME);
                    format(string, sizeof(string), "You have made %s a level %d helper.", szPlayerName, level);
                    SendClientMessage(playerid, COLOR_WHITE, string);

                    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

                    if(level == 0) format(string, sizeof(string), "Administrator %s has removed you from the helpers team.", szPlayerName);
                    else if(level >= playerVariables[playeradmid][pHelper]) format(string, sizeof(string), "Administrator %s has promoted you to a level %d helper.", szPlayerName, level);
                    else if (level <= playerVariables[playeradmid][pHelper]) format(string, sizeof(string), "Administrator %s has demoted you to a level %d helper.", szPlayerName, level);

                    SendClientMessage(playeradmid, COLOR_NICESKY, string);

                    playerVariables[playeradmid][pHelper] = level;    
                }
                else SendClientMessage(playerid, COLOR_GREY, "Valid helpers levels are 0 to 3.");
            }
            else
            {
                new aString[500];
                new query[500];
                format(query, 500,"UPDATE playeraccounts SET playerHelperLevel = '%d' WHERE playerName = '%s'", level, playername);
                mysql_tquery(handle,query);                

                format(aString, sizeof(aString), "Offline: You have made %s helper level %d.", playername, level);
                SCM(playerid,COLOR_BLUE, aString);
                        

            }
        }    
    }
    return 1;
}      

Datele sunt puse corect zic eu , nici-o eroare la compliere.

Rezolvat . Puteti da T/C.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.