Jump to content

Helper


david1995

Recommended Posts

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.

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.