SA-MP Forums Archive
Format problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Format problems (/showthread.php?tid=568856)



Format problems - Hybris - 25.03.2015

Hello im having some trouble with this format I get this error when I try to compile
(7539) : warning 213: tag mismatch
Код:
format(stringbig, sizeof(stringbig),"~r~Reason: ~w~ %s ~n~~r~Banned By: ~w~ %s ~n~~r~Date: ~w~ %d/%d/%s",reason,pName2,Month, Date, YEAR_string);



Re: Format problems - Golf - 25.03.2015

PHP код:
format(stringbigsizeof(stringbig),""r"Reason: "w" %s \n "r"Banned By: "w" %s \n "r"Date: "w"%d/%d/%s",reason,pName2,MonthDateYEAR_string);
#define     r             "{FF0000}" //- Red -// 
#define     w             "{FFFFFF}" //- White  -// 



Re: Format problems - Hybris - 25.03.2015

That didnt work maybe it would be beast to post my whole command
Код:
CMD:ban(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] >= 2)
    {
	   	new pName[MAX_PLAYER_NAME] , pName2[MAX_PLAYER_NAME] , targetid , reason[64] , string[128] , stringbig[256] , YEAR_string[5], Year, Month, Day;
	    GetPlayerName(targetid, pName, sizeof(pName));\
	    GetPlayerName(playerid, pName2, sizeof(pName2));
	    getdate(Year, Month, Day);
	    if(!IsPlayerAdmin(playerid)) return 0;
	    if(sscanf(params, "us[80]", targetid ,reason))  return SendClientMessage(playerid, COLOR_WHITE, "SERVER: "COL_GREEN"/ban [playerid/partofname] [reason]");
	    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: "COL_RED" Player not connected or is yourself!");
	    format(string, sizeof(string), "SERVER: "COL_RED"%s "COL_GREEN"has been banned "COL_RED"(Reason: %s)",pName, reason);
	    SendClientMessageToAll(0xFFFFFF, string);
	    format(YEAR_string, sizeof(YEAR_string), "%d", Year);
	    strdel(YEAR_string, 0, 2);
	    format(stringbig, sizeof(stringbig),""r"Reason: "w" %s \n "r"Banned By: "w" %s \n "r"Date: "w"%d/%d/%s",reason,pName2,Month, Date, YEAR_string);
  	    PlayerTextDrawSetString(playerid,Info[playerid],stringbig);
	    PlayerTextDrawShow(playerid, Info[playerid]);
	    PlayerTextDrawShow(playerid, Box[playerid]);
	    PlayerTextDrawShow(playerid, BannedNotice[playerid]);
	    PlayerTextDrawShow(playerid, Site[playerid]);
	    BanPlayer(targetid, reason, PlayerName(playerid));
	}
	return 1;
}



Re: Format problems - Misiur - 25.03.2015

Typo I guess (but Date exists somewhere so error is misleading):
pawn Код:
//Change
Month, Date, YEAR_string
//to
Month, Day, YEAR_string



Re: Format problems - Hybris - 26.03.2015

Thanks can't believe I didn't see that +rep for both of you.