Errors on sscanf
#1

This is my SetLevel command i have coded using SSCANF, But i am getting errors on the Level setting.
Код:
dcmd_setlevel(playerid,params[])
{
	if (PlayerInfo[playerid][Level] > 1)
	{
	  new LevelUpAnnouncement[128], AdministratorName[MAX_PLAYER_NAME], LevelPlayer[MAX_PLAYER_NAME], PlayerFile[128], id;
	
		if (sscanf(params, "ud", id, Level)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /setlevel [playerid/partname] [level]");
		else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
		else
		{
		  if(PlayerInfo[id][LoggedIn] == 1)
		  {

	 			GetPlayerName(id, LevelPlayer, sizeof(LevelPlayer));

		  	GetPlayerName(playerid, AdministratorName, sizeof(AdministratorName));

			  format(LevelUpAnnouncement, sizeof(LevelUpAnnouncement),"Administrator %s made %s a Administrator [Level: %d]",AdministratorName, LevelPlayer, Level);

			  SendClientMessageToAll(AdministrationAnnouncement, LevelUpAnnouncement);

				PlayerInfo[id][Level] = Level;

				format(PlayerFile, sizeof(PlayerFile), "Users/%s.max", LevelPlayer);

				dini_IntSet(PlayerFile, "AdminLevel", Level);

			 	PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
		 	}
		 	else
		 	{
		 	  SendClientMessage(playerid, AdministrationError, "Error: The player must be logged in to use this command!");
			}
		}
  }
	else
	{
		SendClientMessage(playerid, AdministrationError, NotAdminError);
	}
}
These are the errors:
Код:
C:\Users\Christopher\Desktop\AdminMax.pwn(810) : warning 213: tag mismatch
C:\Users\Christopher\Desktop\AdminMax.pwn(821) : warning 213: tag mismatch
C:\Users\Christopher\Desktop\AdminMax.pwn(825) : warning 213: tag mismatch
C:\Users\Christopher\Desktop\AdminMax.pwn(829) : warning 213: tag mismatch
Код:
Line 810:

if (sscanf(params, "ud", id, Level)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /setlevel [playerid/partname] [level]")

Line 821:

format(LevelUpAnnouncement, sizeof(LevelUpAnnouncement),"Administrator %s made %s a Administrator [Level: %d]",AdministratorName, LevelPlayer, Level);

Line 825:

PlayerInfo[id][Level] = Level;

Line 829:

dini_IntSet(PlayerFile, "AdminLevel", Level);
Dose anyone know what would make these errors occur?, Thanks.
Reply
#2

im not sure but

pawn Код:
if (sscanf(params, "ud", id, Level)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setlevel [playerid/partname] [level]");
try this
Reply
#3

I know this doesn't really relate to your problem, but you should use ZCMD.
Reply
#4

yep faster and easier
Reply
#5

Quote:
Originally Posted by gotenks918
I know this doesn't really relate to your problem, but you should use ZCMD.
Looking into it now thanks

Quote:
Originally Posted by DarK TeaM PT
im not sure but

pawn Код:
if (sscanf(params, "ud", id, Level)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /setlevel [playerid/partname] [level]");
try this
Didn't work :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)