SSCANF Not Initialised error when using /makeadmin
#1

I have this wierd thing when i try to make myself admin, It will just give the usage, And in the console there comes SSCanf not initialised, This is only with the /makeadmin command so far, I updates all plugins, Searched the forum for answers but nothing worked,

Thanks
Reply
#2

try this
Quote:

CMD:makeadmin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 6)
{
new
iAdminValue,
iTargetID;

if(sscanf(params, "ui", iTargetID, iAdminValue))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [level]");
}
else if(IsPlayerConnected(iTargetID))
{
if(AdminDuty[iTargetID] != 0)
{
SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
return 1;
}
new szMessage[47 + (MAX_PLAYER_NAME * 2)];

format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s to Level %d Admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
ABroadCast(COLOR_LIGHTRED,szMessage, 1);
PlayerInfo[iTargetID][pAdmin] = iAdminValue;
format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage);

if(PlayerInfo[iTargetID][pHelper] >= 1) {
PlayerInfo[iTargetID][pHelper] = 0;
PlayerInfo[iTargetID][pAcceptReport] = 0;
}

if(iAdminValue == 0)
{
format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
}
}
else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
}
else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
return 1;
}

Reply
#3

Give code of makeadmin
Else we cant help
Reply
#4

Errors:

C:\Users\-\Desktop\LVRP\gamemodes\LVRPNEW.pwn(459) : error 017: undefined symbol "AdminDuty"
C:\Users\-\Desktop\LVRP\gamemodes\LVRPNEW.pwn(459) : warning 215: expression has no effect
C:\Users\-\Desktop\LVRP\gamemodes\LVRPNEW.pwn(459) : error 001: expected token: ";", but found "]"
C:\Users\-\Desktop\LVRP\gamemodes\LVRPNEW.pwn(459) : error 029: invalid expression, assumed zero
C:\Users\-\Desktop\LVRP\gamemodes\LVRPNEW.pwn(459) : fatal error 107: too many error messages on one line

EDIT:
Makeadmin code:

CMD:makeadmin(playerid, params[])
{
new pID, value;

if(PlayerInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not authorized to use that command");
else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, -1,"USAGE: /makeadmin [playerid/PartOfName] [level 1-5]");
else if (value < 0 || value > 5) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid level specified !(1-5)");
else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2,"Invalid player specified !");
else
{
new tName[MAX_PLAYER_NAME], string[128];
GetPlayerName(pID, tName, MAX_PLAYER_NAME);
strreplace(tName, '_', ' ');
format(string, sizeof(string), "* You've promoted %s to an level %d Administrator.", tName, value);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You've been promoted to an level %d Administrator by %s.", value, GetName(playerid));
SendClientMessage(pID, COLOR_LIGHTBLUE, string);
printf("AdmCmd: %s has promoted %s to a level %d admin.", GetName(playerid), tName, value);
PlayerInfo[pID][pAdmin] = value;
}
return 1;
}
Reply
#5

bump..
Reply
#6

I gonna se if i can fix this.
Im at my computer now.
Reply
#7

Quote:
Originally Posted by Meller
Посмотреть сообщение
I gonna se if i can fix this.
Im at my computer now.
Couldn't test any other commands due to i can't make myself admin, But my playerfiles aren't saving either
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)