SetSpawnInfo is not working correctly?
#1

So here's the thing, i have a register system made with dini.
Once a player logs in, he gets spawned right away.
But for some odd reason, the server doesn't set the player's skin correctly, it just gets set to 0.

Here's the code:
Код:
		if(Stats[playerid][Spawned] == true)
		{
			SetSpawnInfo(playerid, 0, Stats[playerid][Skin], Float:dini_Float(file,"X"),Float:dini_Float(file,"Y"),Float:dini_Float(file,"Z"), 0, 0, 0, 0, 0, 0, 0 );
			SpawnPlayer(playerid);
			SetPlayerInterior(playerid,Stats[playerid][Interior]);
			GivePlayerMoney(playerid, Stats[playerid][Money]);
			SetPlayerColor(playerid, WHITE);
			SetPlayerSkin(playerid, Stats[playerid][Skin]);
		}
Can anyone please help?
Reply
#2

I guess it's because you set the player's skin to 0??

pawn Код:
SetSpawnInfo(playerid, 0, Stats[playerid][Skin], Float:dini_Float(file,"X"),Float:dini_Float(file,"Y"),Float:dini_Float(file,"Z"), 0, 0, 0, 0, 0, 0, 0 );
You want from the compiler to set the skin to the saved one, but at the same time, you're setting it to 0?
Reply
#3

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
I guess it's because you set the player's skin to 0??

pawn Код:
SetSpawnInfo(playerid, 0, Stats[playerid][Skin], Float:dini_Float(file,"X"),Float:dini_Float(file,"Y"),Float:dini_Float(file,"Z"), 0, 0, 0, 0, 0, 0, 0 );
You want from the compiler to set the skin to the saved one, but at the same time, you're setting it to 0?
The 0 is the team.
Reply
#4

My bad...
I suggest you to get something newer and faster, there are so many new systems...

But well, show me where you save the player's skin...
Reply
#5

The skin gets saved correctly.
Код:
dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
Problem is with the loading.
Reply
#6

What is Stats[playerid][Skin]? Do you have some command like /myskin [skinid] (that will change the Stats[playerid][Skin] to the skinid the player typed?)
Reply
#7

Here is the code that saves the skin to a variable.

Код:
Stats[playerid][Skin] = dini_Int(file,"Skin");
Reply
#8

Does it load the money properly? if so, check it saves the skin.
Reply
#9

Quote:
Originally Posted by Toreno
Посмотреть сообщение
Does it load the money properly? if so, check it saves the skin.
Yes, the money loads up and everything.
I get the money once i spawn, but seems like even the SetPlayerSkin isn't working.

Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerSkin(playerid,Stats[playerid][Skin]);
	return 1;
}
Reply
#10

Quote:
Originally Posted by Shetch
Посмотреть сообщение
Here is the code that saves the skin to a variable.

Код:
Stats[playerid][Skin] = dini_Int(file,"Skin");
Wait show the command where you do /myskin [Skin id]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)