PAWN anomalies
#1

Story is that I'm making another big gamemode again and once again PAWN is making my life pure hell. My gamemode is not arhitectured like most of the gamemodes, like 1 file and that's it. As I like things be organized, I made things a bit more categorized.
Now the problem is in when player logs in. Here's a quick code about the problematic spot in database include file:

:: SCMTA = SendClientMessageToAll
Код:
... Fetching player data logic here ...

			SCMTA(WHITE, "1");
			ResetGiveSavePlayerMoney(playerid, pS[playerid][pID], pS[playerid][pMoney]);
			format(_loginString, sizeof(_loginString), "Last login: %s | Last login IP: %s", pS[playerid][pLastLoginDate], pS[playerid][pLastLoginIP]);
			SendNotification(playerid, 3, _loginString);

			format(_query,sizeof(_query),"UPDATE `players` SET `lastLoginIP`='%s', `lastLoginDate`='%s' WHERE (`name` = '%s')", GetPlayerIpEx(playerid), GetDateTime(), GetPlayerNameEx(playerid));
			mysql_query(_query);

			SetSpawnInfo(playerid, 0, pS[playerid][pSkin], pS[playerid][pX], pS[playerid][pY], pS[playerid][pZ], pS[playerid][pR], 0, 0, 0, 0, 0, 0);
			SCMTA(WHITE, "2");
		        SpawnPlayer(playerid);

			SCMTA(WHITE, "3");
		}
	}
	else
	{
	    Kick(playerid);
	}

	SCMTA(WHITE, "4");

	return 1;
}
The problem here is that all those numbers are sent to client. But SpawnPlayer isn't called out. It feels like the PAWN just skippes that part and moves on. Before I had similar problem too about IF statements. After the place got to if, the script like doesn't ran any furter.
But it compiles fine with no errors.

So does anyone know what might cause this kind of anomaly. I would be really greatful if someone could help me out on this.
Reply
#2

Fix found! Problem was really wierd because after this function: mysql_fetch_row(SQLData);
somehow parameter playerid was changed from original value to 124.

If anyone will encounter again this kind of problem then you might wanna check your variable sizes.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)