ann command causes crash
#5

Код:
CMD:ann(playerid, params[])
{
    if(Player[playerid][Level] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{0099FF}>> {EEEEEE}Error: {0099FF}You Need High level.");
	new textt[56];
	if(sscanf(params, "s[128]", textt)) return SendClientMessage(playerid, -1, "/ann text");
	if(!IsSafeGametext(textt)) return SendClientMessage(playerid, -1, "You're probably missing a '~' which can crash you and/or other clients!");
	GameTextForAll(textt, 4000, 3);
    new pNamex[32], msgg[128];
    GetPlayerName(playerid, pNamex, sizeof(pNamex));
    format(msgg, sizeof(msgg), "Admi {FFFFFF}%s envio ann", pNamex);
    SendClientMessageToAll(-1, msgg);
	return 1;
}
stock IsEven(integer)
{
	if(integer % 2 == 0)
		 return 1;
	return 0;
}

stock IsSafeGametext(text[])
{
	new cnt = 0;
	for(new i = 0; i < strlen(text); i ++)
	{
		if(text[i] == '~')
			cnt ++;
	}
	if(IsEven(cnt) == 0)
		return 0;
	return 1;
}
Reply


Messages In This Thread
ann command causes crash - by vegaltasendai - 26.03.2018, 22:21
Re: ann command causes crash - by UFF - 27.03.2018, 02:20
Re: ann command causes crash - by vegaltasendai - 27.03.2018, 04:45
Re: ann command causes crash - by UFF - 27.03.2018, 05:21
Re: ann command causes crash - by AlamoTR - 27.03.2018, 06:16
Re: ann command causes crash - by vegaltasendai - 27.03.2018, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)