Makeadmin command bug
#1

Guys.I have a script that when we type /setvip or /makeadmin,the server which is based on Volt Host does a restart.Force Restart.Any ideas how i can fix this?
Reply
#2

Bump!!
Reply
#3

Show the commands, please
Reply
#4

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Show the commands, please
pawn Код:
CMD:makeadmin(playerid, params[])  {
    if(PlayerInfo[playerid][pAdmin] >= 100004) {

        new
        iAdminValue,
        iTargetID;

        if(sscanf(params, "ui", iTargetID, iAdminValue)) {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
        }
        else if(IsPlayerConnected(iTargetID)) {
            if(PlayerInfo[iTargetID][pHelper] >= 1) {
                SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot make Community Helpers admins!");
            }
            else {

                new
                szMessage[47 + (MAX_PLAYER_NAME * 2)];

                PlayerInfo[iTargetID][pAdmin] = iAdminValue;
                format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
                ABroadCast(COLOR_LIGHTRED,szMessage, 2);
                format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
                SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
                format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
            }
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    return 1;
}
pawn Код:
CMD:setvip(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
    if (PlayerInfo[playerid][pAdmin] >= 100002 || PlayerInfo[playerid][pShopTech] >= 1)
    {
        new string[128], giveplayerid, level;
        if(sscanf(params, "ud", giveplayerid, level))
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setvip [playerid] [level]");
            SendClientMessageEx(playerid, COLOR_GRAD3, "Available Levels: |0| None |1| Bronze |2| Silver |3| Gold |4| Platinum |5| Moderator");
            return 1;
        }

        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                if(level < 0 || level > 5)
                {
                    SendClientMessageEx(playerid, COLOR_GRAD1, "VIP Level can not be below 0 or above 5!");
                    return 1;
                }
                PlayerInfo[giveplayerid][pDonateRank] = level;
                PlayerInfo[giveplayerid][pTempVIP] = 0;
                PlayerInfo[giveplayerid][pBuddyInvited] = 0;
                new year, month,day;
                getdate(year, month, day);
                new playerip[32];
                GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
                if(level == 0)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to None (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to None (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to None by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
                    PlayerInfo[giveplayerid][pTokens] = 0;

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to None (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
                if(level == 1)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Bronze (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Bronze (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to Bronze by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Bronze (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
                if(level == 2)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Silver (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Silver (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to Silver by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Silver (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
                if(level == 3)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Gold (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Gold (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to Gold by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Gold (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
                if(level == 4)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Platinum (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Platinum (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to Platinum by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

                    // Level 5 Arms Job - Platinum VIP
                    PlayerInfo[giveplayerid][pArmsSkill] = 401;

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Platinum (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
                if(level == 5)
                {
                    if (PlayerInfo[playerid][pAdmin] < 1337)
                    {
                        format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Moderator (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                        SendClientMessageEx(playerid, COLOR_LIGHTRED, string);
                    }
                    format(string, sizeof(string), "AdmCmd: %s has set %s's VIP level to Moderator (%d).", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), level);
                    ABroadCast(COLOR_LIGHTRED,string, 1337);
                    format(string, sizeof(string), "Your VIP level has been set to Moderator by Admin %s.", GetPlayerNameEx(playerid));
                    SendClientMessageEx(giveplayerid, COLOR_WHITE, string);

                    format(string, sizeof(string), "AdmCmd: %s has set %s's (IP:%s) VIP level to Moderator (%d). (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), playerip, level, month,day,year);
                    Log("logs/setvip.log", string);
                    return 1;
                }
            }
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    }
    return 1;
}
Even if i make myself from the .ini files.I cant even log in,and it restarts.Please helpme out
Reply
#5

Hmm, nothing seems to be wrong here. Maybe something is messed with writing/reading from file?
Reply
#6

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Hmm, nothing seems to be wrong here. Maybe something is messed with writing/reading from file?
On my PC and on my friend that used to host,everything was working perfectly.Can it bee from volt host's system?Or from their auto restarter.That when you server gets down,it gets up auto?
Reply
#7

Oh, then, it is definetely host problem. Are you sure that you uploaded files correctly?
Reply
#8

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Oh, then, it is definetely host problem. Are you sure that you uploaded files correctly?
If they arent correct,server wont run at all..
Reply
#9

Well, really difficult to say something valuable. I think you should talk to their support.
Reply
#10

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Well, really difficult to say something valuable. I think you should talk to their support.
Hello,

It is most certainly script related. All our auto restarter does is start your server ONCE it has crashed. Its crashing on its own. Check the difference between a normal player and admin logging into the server. There will be the exact code that is causing it (could just be 1 simple line)

Regards,
Brad W

They'r answer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)