SetSpawnInfo problem -
dusk - 20.05.2013
The problem is that it doesn't work for me. It doesn't set the right skin, always 0. I send a query OnPlayerConnect and SpawnPlayer as soon as he logins.
Here's the loading:
pawn Код:
forward OnSpawnCheck(playerid);
public OnSpawnCheck(playerid)
{
new tmp[32],Float:Pos[3],skin;
cache_get_row(0,0,tmp,dbHandle); skin=strval(tmp);
cache_get_row(0,1,tmp,dbHandle); Pos[0]=floatstr(tmp);
cache_get_row(0,2,tmp,dbHandle); Pos[1]=floatstr(tmp);
cache_get_row(0,3,tmp,dbHandle); Pos[2]=floatstr(tmp);
printf("%d",skin);
SetSpawnInfo(playerid,0,skin,Pos[0],Pos[1],Pos[2],0,0,0,0,0,0,0);
return 1;
}
And it prints out the skin correctly. But it's not loaded... The coordinates are correct.
Re: SetSpawnInfo problem -
Avi Raj - 20.05.2013
use this :-
pawn Код:
forward OnSpawnCheck(playerid);
public OnSpawnCheck(playerid)
{
new tmp[32],Float:Pos[3],skin;
cache_get_row(0,0,tmp,dbHandle); skin=strval(tmp);
cache_get_row(0,1,tmp,dbHandle); Pos[0]=floatstr(tmp);
cache_get_row(0,2,tmp,dbHandle); Pos[1]=floatstr(tmp);
cache_get_row(0,3,tmp,dbHandle); Pos[2]=floatstr(tmp);
cache_get_row(0,4,tmp,dbHandle); Pos[3]=floatstr(tmp);
printf("%d",skin);
SetSpawnInfo(playerid,0,skin,Pos[0],Pos[1],Pos[2],Pos[3],0,0,0,0,0,0); // pos[3] // For Floating Angle
return 1;
}
Re: SetSpawnInfo problem -
dusk - 20.05.2013
Okay..that will set the player's facing angle. But how does that help me with my problem?
Re: SetSpawnInfo problem -
Avi Raj - 20.05.2013
What skin you need?
Random or what?
Re: SetSpawnInfo problem -
Abhishek. - 20.05.2013
Quote:
It doesn't set the right skin, always
0.
seSetSpawnInfo(playerid,0,skin,Pos[0],Pos[1],Pos[2],Pos[3],0,0,0,0,0,0
what would you expect when its set to 0
|
2nd parameter
Re: SetSpawnInfo problem -
dusk - 20.05.2013
Avi Raj, i need the skin it loads...Which is not 0 in the DB.
Abhishek, I dare to disagree:
https://sampwiki.blast.hk/wiki/SetSpawnInfo
Re: SetSpawnInfo problem -
dusk - 21.05.2013
bump
Re: SetSpawnInfo problem -
Avi Raj - 21.05.2013
dusk, i was Helping you and you did : -Rep!
Lol, then don't think someone will Help you.
Re: SetSpawnInfo problem -
Abhishek. - 21.05.2013
he wants the sking he loads from the mysql database
Код:
cache_get_row(0,0,tmp,dbHandle); skin=strval(tmp);
i cant help coz i dont have any knowledge on mysql databse
EDIT:well do it prints correctly?
Re: SetSpawnInfo problem -
dusk - 21.05.2013
Avi Raj, I did NOT -rep you. Why should I do that? You tried, and I appreciate it.
Abhishek, yes it is printed out correctly.