Pawn compiler crashes, if/else if statement
#1

Code:
	
new name[24], string[2];

GetPlayerName(playerid, name, sizeof(name));
if(sscanf(name, "{p<_>s[12]s[12]}") != 0)
{
	SendClientMessage(playerid, 0xFFFFFFFF, "* Invalid roleplay username, kicked.");
	DelayedKick(playerid);
}
else if
{
	for(new i = 0; i < 10; i ++)
	{
		format(string, sizeof(string), "%d", i);
		if(strfind(name, string, true) != -1)
		{
			SendClientMessage(playerid, 0xFFFFFFFF, "* Invalid roleplay username, kicked.");
			DelayedKick(playerid);
		}
	}
}
else
{
	//code...
}
Coming back to Pawn, working on a sample script. What that snippet does it to check a connecting user's username, and see if it follows the Firstname_Lastname format. If I compile that script, the compiler crashes after 10 seconds +/-. Not sure what the issue is, any help would be appreciated at this point.
Reply


Messages In This Thread
Pawn compiler crashes, if/else if statement - by Sublime - 12.06.2017, 04:08
Re: Pawn compiler crashes, if/else if statement - by SoFahim - 12.06.2017, 05:22
Re: Pawn compiler crashes, if/else if statement - by Vince - 12.06.2017, 07:10

Forum Jump:


Users browsing this thread: 1 Guest(s)