22.02.2017, 20:16
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:
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...
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; }
EDIT: I tried the older gamemode and it didn't work as well so I assume there's nothing to do with the code...