23.09.2017, 19:43
I have this annoying bug, when you register players camera is set in one place and not showing the "Spawn" button nor the arrows to choose the skin. When logging in i dont have this problem.
OnPlayerRequestClass:
OnPlayerConnect:
OnPlayerDisconnect:
OnPlayerSpawn:
I have no errors nor warnings when compiling the script, any suggestions?
OnPlayerRequestClass:
Код:
public OnPlayerRequestClass(playerid, classid) { SetPlayerInterior(playerid,11); SetPlayerPos(playerid,508.7362,-87.4335,998.9609); SetPlayerFacingAngle(playerid,0.0); SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609); SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609); return 1; }
Код:
public OnPlayerConnect(playerid) { { new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), "%s has joined the server", pname); SendClientMessageToAll(0xAAAAAAAA, string); } if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit"); SetPlayerScore(playerid,PlayerInfo[playerid][pScore]); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit"); SendClientMessage(playerid,COLOR_RED,"Type /spawn to spawn yourself succesfully."); } SetPlayerMapIcon(playerid, 12, 2413.159912, 1123.804077, 10.820312, 52, 0, MAPICON_LOCAL); return 1; }
Код:
public OnPlayerDisconnect(playerid, reason) { { new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); switch(reason) { case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname); case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname); case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname); } SendClientMessageToAll(0xAAAAAAAA, string); } new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"Score",GetPlayerScore(playerid)); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_Close(File); return 1; }
Код:
public OnPlayerSpawn(playerid) { SetPlayerInterior(playerid,0); return 1; }