29.05.2012, 17:08
Hi guys! 
I have a little problem with SetSpawnInfo, here we go:
1є. I have a Dialog for login in OnPlayerConnect, if the password is OK it calls a function which loads the data throught SQLite, and set it in variables.
Example:
Well, the Dialog is in OnPlayerConnect and if it responses and the password is correct I call the function to log him. But when he spawns always has the skin 0. =/
By the way, I think OnPlayerSpawn isn't called and after death neither. :O
Thank you!

I have a little problem with SetSpawnInfo, here we go:
1є. I have a Dialog for login in OnPlayerConnect, if the password is OK it calls a function which loads the data throught SQLite, and set it in variables.
Example:
pawn Код:
LoadUserData(playerid)
{
//queries... etc etc
if(db_num_rows(Result))
{
new field[20];
//other data...
db_get_field_assoc(Result, "skin", field, 20);
p_Info[playerid][pSkin] = strval(field);
//Variable to know if he is registered and passed the tutorial.
db_get_field_assoc(Result, "tuto", field, 20);
p_Info[playerid][pTuto] = strval(field);
//Well, and here I have this:
if(p_Info[playerid][pTuto] >= 1)
{
//Set skin and spawn position.
SetSpawnInfo(playerid,0, p_Info[playerid][pSkin],
p_Info[playerid][pPosX],
p_Info[playerid][pPosY],
p_Info[playerid][pPosZ],
0.0,0,0,0,0,0,0);
SpawnPlayer(playerid); //And I spawn him.
} else {
//Register part...
}
}
return 1;
}
By the way, I think OnPlayerSpawn isn't called and after death neither. :O
Thank you!

