Request Class Error
#1

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
Reply
#2

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.
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)