SA-MP Forums Archive
Request Class Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Request Class Error (/showthread.php?tid=648745)



Request Class Error - MiyuUchiha - 28.01.2018

Hello There, I have a problem, i came back to SA-MP Coding after a years Programming C++ and C#, i have a problem, Whenever i logged in into my account, it instantly set the camera to the place that has escalator in LV


i don't know where is the problem, i already tried to call OnPlayerRequestClass, but it doesn't work
Код:
cache_set_active(pInfo[playerid][Player_Cache]);

cache_get_value_int(0, "KILLS", pInfo[playerid][Kills]);
cache_get_value_int(0, "DEATHS", pInfo[playerid][Deaths]);

cache_get_value_int(0, "SCORE", pInfo[playerid][Score]);
cache_get_value_int(0, "CASH", pInfo[playerid][Cash]);

SetPlayerScore(playerid, pInfo[playerid][Score]);

ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, pInfo[playerid][Cash]);

cache_delete(pInfo[playerid][Player_Cache]);
pInfo[playerid][Player_Cache] = MYSQL_INVALID_CACHE;

pInfo[playerid][LoggedIn] = true;
SendClientMessage(playerid, 0x00FF00FF, "Logged in to the account.");
OnPlayerRequestClass(playerid, 0);
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}
pls help :c


Re: Request Class Error - Sew_Sumi - 28.01.2018

Are you using just the gamemode script, or have you got filterscripts in there too? I'd disable them and try with just the script itself, and if that still doesn't come right, I'd start with a bare script and test the spawn by itself entirely.


Re: Request Class Error - MiyuUchiha - 10.02.2018

nope, it is only gamemode, i haven't placed any fs in the source code.


Re: Request Class Error - Mugala - 10.02.2018

do u have AddPlayerClass in your code?
and press left or right and check if your code works.