[Help]Spawn problem!
#1

When somone registers on my server and picks like male gender I want to set him certain skin for that gender. But the problem is when he spawns it spawns in the cj skin I dont know how to resolve this. This is my code
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], 1714.8339, -1912.6870, 13.5666, 269.15, 26, 36, 28, 500, 0, 0);
	SpawnPlayer(playerid);
	return 1;
}
if(dialogid == DIALOG_SPOL)
	{
		if(response)
		{

			if(listitem == 0) //
			{
				PlayerInfo[playerid][pSkin] = 59;
				PlayerInfo[playerid][pSpol] = 1;
				new INI:File = INI_Open(Path(playerid));
				new Spol = PlayerInfo[playerid][pSpol];
				new Skin = PlayerInfo[playerid][pSkin];
				INI_WriteInt(File,"Spol", Spol);
				INI_WriteInt(File,"Skin", Skin);
				INI_Close(File);
			}
			if(listitem == 1) //
			{
				PlayerInfo[playerid][pSkin] = 59;
				PlayerInfo[playerid][pSpol] = 2;
				new INI:File = INI_Open(Path(playerid));
				new Spol = PlayerInfo[playerid][pSpol];
				new Skin = PlayerInfo[playerid][pSkin];
				INI_WriteInt(File,"Spol", Spol);
				INI_WriteInt(File,"Skin", Skin);
				INI_Close(File);
			}
		}
		return 1;
	}
Reply
#2

Afaik, if you use a dialog on onplayerconnect so your OnPlayerRequestClass(playerid, classid) isn't called, before players clicked arrow button on class selection.
Put this code under OnPlayerSpawn(playerid);
Код:
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
Reply
#3

When I am creating account it works but when I quit the game and come back when i am logging in to the account it says that the password is incorrect but when I shut down the server and try to login the password is okay but the skin is not showing and my money isnt loaded. Like example I give player on register 1000$ and it saves that in the user folder and everything is saved perfectly but when I login it doesnt give me that 1000$ and it doesnt set my skin. Like its not loading the user file that is created.
Reply
#4

Can you show the code?
Reply
#5

I can send you the whole code if u want...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)