Errror
#1

Code:
 CMD:auninvite(playerid, params[])
{
	new target, reason[50], fp;
	if(sscanf(params, "uis[50]", target, fp,reason)) return SCM(playerid, -1, "Syntax: /auninvite [playerid] [amount of fp] [reason]");
	if(playerVariables[playerid][pAdminLevel] >= 5)
	{
		if(IsPlayerConnected(target))
		{
			if(playerVariables[target][pGroup] != 0)
			{
				if(playerVariables[target][pGroupRank] != 0)
				{
					if(fp >= 0)
					{
						new str[256], dayz;
						mysql_format(handle, str, 256, "SELECT * FROM `playeraccounts` WHERE `playerName` = '%e'", playerVariables[target][pNormalName]);
						new Cache: resa = mysql_query(handle, str);
						if(cache_get_row_count() != 0)
						{
							cache_get_field_content(0, "playerDays", result); dayz = strval(result);
						}
						cache_delete(resa);
						new group = playerVariables[target][pGroup];
						format(szMessage, sizeof(szMessage), "%s has been uninvited by admin %s from %s, with %i FP, after %d days, reason: %s", playerVariables[target][pNormalName], playerVariables[playerid][pNormalName], groupVariables[group][gGroupName],  fp, dayz,reason);
						SendToGroup(group, COLOR_GENANNOUNCE, szMessage);
						SCM(playerid, COLOR_GENANNOUNCE, szMessage);
						new quer[2560];
						playerVariables[target][pSkin] = 299;
						SetPlayerSkin(target, 299);
						new year, month, day, hour, minute, second;
						new time[25];
						gettime(hour, minute, second);
						getdate(year, month, day);
						format(time, 25, "%02d.%02d.%d %02d:%02d:%02d", day, month, year, hour, minute, second);
						mysql_format(handle, quer, sizeof(quer), "INSERT INTO faction_logs (text, playerID, playerSkin, time) VALUES ('%e', '%d', '%d', '%e')", szMessage,playerVariables[target][pInternalID], playerVariables[target][pSkin], time);
						mysql_tquery(handle,quer);
						playerVariables[target][pPoliceDuty] = 0;
						playerVariables[target][pFP] = fp;
						playerVariables[target][pFW] = 0;
						playerVariables[target][pGroup] = 0;
						playerVariables[target][pGroupRank] = 0;
						SetPlayerColor(target, COLOR_WHITE);
						MaskUse[target] = 0;

						TextDrawHideForPlayer(target, tTimer[target]);
						for(new i; i <= sizeof(TurfInfo)-1; i++)
						{
							GangZoneStopFlashForPlayer(target, Turfs[i]);
						}
						OnPlayerSpawn(target);
						savePlayerData(target);
					}
					else
					{
						SCM(playerid, -1, "The minimum amount of FP is 0!");
					}
				}
				else
				{
					SCM(playerid, -1, "This player isn't in a faction!");
				}
			}
			else
			{
				SCM(playerid, -1, "This player is a Civillian!");
			}
		}
		else
		{
			SCM(playerid, -1, "This player is not connected!");
		}
	}
	else
	{
		SCM(playerid, -1, "You are not an admin!");
	}
	return 1;
}
Errors:
Code:
 :\Burrned\gamemodes\agb.pwn(15456) : error 029: invalid expression, assumed zero
D:\Burrned\gamemodes\agb.pwn(15456) : error 029: invalid expression, assumed zero
D:\Burrned\gamemodes\agb.pwn(15456) : warning 215: expression has no effect
D:\Burrned\gamemodes\agb.pwn(15456) : error 001: expected token: ";", but found "]"
D:\Burrned\gamemodes\agb.pwn(15456) : fatal error 107: too many error messages on one line
Plese help me to do this errors!
15456 ist " if(playerVariables[playerid][pAdminLevel] >= 5)"
Reply
#2

You don't need to specify the lenght of the string in sscanf, I'm not even sure if you can. You should use "uis" and check the lenght of the string somewhere within the function.

As for the error line, it seems about right honestly. It seems to have a problem parsing what playerVariables is for some reason.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)