some parts not working at OnPlayerRequestClass
#1

Hi, I made some changes to the ban system and now some parts don't seem to work under OnPlayerRequestClass.
This is what it looks like:
Код:
public OnPlayerRequestClass(playerid, classid)
{
	print("called");
	
	if (!PlayerInfo[playerid][pLogged])
	{
	        print("not logged in");
	    
		new query[128];
		
		RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 956, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
		RemoveBuildingForPlayer(playerid, 1977, 0.0, 0.0, 0.0, 6000.0);
		
		if (g_CustomTime == -1)
		{
			new hour, minute;
			gettime(hour, minute);
			
			SetPlayerTime(playerid, hour, minute);
		}
		else SetPlayerTime(playerid, g_CustomTime, 0);
		
		SetPlayerWeather(playerid, g_Weather);
		
		ClearChat(playerid);
		SetPlayerColor(playerid, -1);
		
		TogglePlayerSpectating(playerid, true);
		SetTimerEx("SetCamera", 250, false, "d", playerid);
		
		mysql_format(g_MySQL, query, sizeof(query), "SELECT `ID`, `Password`, `Salt` FROM `accounts` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
		mysql_tquery(g_MySQL, query, "OnPlayerQueryFinished", "dd", playerid, QUERY_ACCOUNT_CHECK);
		
		print("sending query");
	}
	else SpawnPlayer(playerid);
	return 1;
}
It puts player in spectating mode, sets the camera, weather, time, etc like it's supposed to, but it doesn't print any of the messages nor it does send the query. It connects successfully to the database and I got crashdetect, but it doesn't say anything. Nothing in the MySQL log as well. What's up?

EDIT: I tried the older gamemode and it didn't work as well so I assume there's nothing to do with the code...
Reply
#2

Check your custom functions (such as ClearChat as I have seen) make sure you don't have any returns in it, Used to have a similar issue like this before with a SendMessageToAdmins custom function.
Reply
#3

It doesn't even print "called" that is above everything. Also I edited the post saying that the older version of the gamemode doesn't work as well so I don't think it's something wrong with the code.

EDIT: Fixed. I needed #pragma dynamic here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)