SetSpawnInfo - spawned with wrong info
#1

Code:
pawn Код:
format(query,sizeof(query),"SELECT X,Y,Z,Interior,VirtualWorld,Skin FROM users WHERE UserId = %d",pInfo[playerid][SqlId]);
    mysql_tquery(DbHandle,query,"OnSpawnSetup","i",playerid);

forward OnSpawnSetup(playerid);
public OnSpawnSetup(playerid)
{
    SetSpawnInfo(playerid,0,cache_get_row_int(0,5),cache_get_row_int(0,0),cache_get_row_int(0,1),cache_get_row_int(0,2),0.0,0,0,0,0,0,0);
    SetPlayerInterior(playerid,cache_get_row_int(0,3));
    SetPlayerVirtualWorld(playerid,cache_get_row_int(0,4));
        printf("[%s]skin:%d, X:%f",pInfo[playerid][Username],cache_get_row_int(0,5),cache_get_row_float(0,0));
    SpawnPlayer(playerid);
    MainTimer[playerid] = SetTimerEx("MainTimerFunction",60000,true,"i",playerid);
    return 1;
}
And I spawn at the correct position, but the skin is wrong. Although it's printed correctly..
Reply
#2

Do you set the player's skin during OnPlayerSpawn? Besides your function ofc
Reply
#3

No, this is the only place where I set it, besides when getting a job.
Reply
#4

I don't know what the problem is but why don't you set a variable to true in OnSpawnSetup and when OnPlayerSpawn is called, check if it's true and set the skin there by SetPlayerSkin (store it somewhere of course) and then set the variable to false.

PS: Aren't the X, Y, Z floats? Why don't you use cache_get_row_float instead?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)