Class Selection [+REP]
#1

Hello there, I need help with one little thing. I have made a login and register system. So if player 1st time on server he gets class selection and spawns at the right place. But when i log off and go in its suppose to load the skin he picked but it loads the Cj skin. I hope you can help!
Reply
#2

Show some codes.
Reply
#3

I just took the parts out of the skin save

Код:
OnPlayerSpawn(playerid)
{
        SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
        if(PlayerInfo[playerid][pFirst] == 1)
        {
	   SetPlayerPos(playerid, -87.2374,1220.9498,19.7422);
        }
       return 1;
}
Код:
public OnPlayerDisconnect(playerid, reason)
{
	new name[MAX_PLAYER_NAME], file[256];
	new weapons[13][2];
    GetPlayerName(playerid, name, sizeof(name));
    new PlayerCash, PlayerSkin;
	format(file, sizeof(file), SERVER_USER_FILE, name);
    if(PlayerLogged[playerid] == 1)
    {
    	new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
		dini_IntSet(file,"Admin Rank",PlayerInfo[playerid][pAdmin]);
	    dini_IntSet(file,"Beta Rank",PlayerInfo[playerid][pBeta]);
	    dini_IntSet(file,"Job",PlayerInfo[playerid][pJob]);
	    dini_IntSet(file,"Faction",PlayerInfo[playerid][pFaction]);
	    dini_IntSet(file,"Rank",PlayerInfo[playerid][pRank]);
     	dini_FloatSet(file, "PosX", x);
        dini_FloatSet(file, "PosY", y);
        dini_FloatSet(file, "PosZ", z);
	    dini_IntSet(file,"Phone",PlayerInfo[playerid][pPhone]);
	    dini_IntSet(file,"FirstSpawn",PlayerInfo[playerid][pFirst] = 0);
		PlayerSkin = GetPlayerSkin(playerid);
		PlayerCash = GetPlayerMoney(playerid);
	 	dini_IntSet(file, "Skin", PlayerSkin);
	 	dini_IntSet(file, "Money",PlayerCash );
           }
          return 1;
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(PlayerInfo[playerid][pSkin] != 0)
	{
		return SpawnPlayer(playerid);
	}
    if(PlayerInfo[playerid][pFirst] == 1)
    {
		AddPlayerClass(12,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
    	AddPlayerClass(10,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
		AddPlayerClass(17,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
		AddPlayerClass(20,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
		AddPlayerClass(49,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
		AddPlayerClass(14,-87.2374,1220.9498,19.7422,179.2150,0,0,0,0,0,0);
    }
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)