SetSpawnInfo is not working correctly? -
Shetch - 16.02.2012
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?
Re: SetSpawnInfo is not working correctly? -
Twisted_Insane - 16.02.2012
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?
Re: SetSpawnInfo is not working correctly? -
Shetch - 16.02.2012
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.
Re: SetSpawnInfo is not working correctly? -
Twisted_Insane - 16.02.2012
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...
Re: SetSpawnInfo is not working correctly? -
Shetch - 16.02.2012
The skin gets saved correctly.
Код:
dini_IntSet(file,"Skin",GetPlayerSkin(playerid));
Problem is with the loading.
Re: SetSpawnInfo is not working correctly? -
Tanush123 - 16.02.2012
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?)
Re: SetSpawnInfo is not working correctly? -
Shetch - 16.02.2012
Here is the code that saves the skin to a variable.
Код:
Stats[playerid][Skin] = dini_Int(file,"Skin");
Re: SetSpawnInfo is not working correctly? -
Toreno - 16.02.2012
Does it load the money properly? if so, check it saves the skin.
Re: SetSpawnInfo is not working correctly? -
Shetch - 16.02.2012
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;
}
Re: SetSpawnInfo is not working correctly? -
Tanush123 - 16.02.2012
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]