SetSpawnInfo problem
#1

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.
Reply
#2

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;
}
Reply
#3

Okay..that will set the player's facing angle. But how does that help me with my problem?
Reply
#4

What skin you need?
Random or what?
Reply
#5

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
Reply
#6

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
Reply
#7

bump
Reply
#8

dusk, i was Helping you and you did : -Rep!
Lol, then don't think someone will Help you.
Reply
#9

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?
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)