Virtual World problem
#1

Hey there, I'm having a quite weird problem about setting virtual world for player.

When player spawns he should get virtualworld from y_ini file. and its written there but yet it always set the virtual world to 0. ex: file has value 2 and player spawns in virtual world 0, even after using SetPlayerVirtualWorld.

Some codes (Won't show the savechar stock as it is saving the right values to the file, loadings is the problem):

(Other stuff load perfectly, the problem is only with virtual world)
Under LoadUser_PlayerData(playerid,name[],value[]): (executed before onplayer spawn)
pawn Код:
INI_Int("VirutalWorld", PlayerInfo[playerid][pVW]);
return 1;
Under OnPlayerSpawn(playerid)
pawn Код:
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
(I'm setting virtualworld after position&interior)
Why does it always spawns player with virtual world 0?
Reply
#2

In OnPlayerConnect you need make the coding where you want him to spawn, orelse everytime he spawns in Virtual world 0
Reply
#3

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
In OnPlayerConnect you need make the coding where you want him to spawn, orelse everytime he spawns in Virtual world 0
What? Its not possiable to spawn him and then just set his virtual world?
OnPlayerConnect player needs to login, not to spawn. Sorry is there any better solution?

P.S. why isn't it mention anywhere that player must spawn in OnPlayerConnect to be in changed virtual world?
Reply
#4

Say me 1 thing where to you want time to spawn in a virtual wolrld after he connects or what?
Reply
#5

Do me a favor, print out "PlayerInfo[playerid][pVW]" in a test command, and post the output here.
Reply
#6

Sickattack first let's know what he needs , then we can help him with clear explaination, if he wants the player to be spawned directly to the virtual world then it can be done , orlese he wants the player to be spawned after a Cmd typed , this depends in this matter how do he wants to spawn that player...
Reply
#7

Perhaps you are setting his vw to 0 anywhere else in your OnPlayerSpawn Callback. Look for SetPlayerVirtualWorld functions in your script.
Reply
#8

1) No, I'm not setting anywhere the virtual world to 0.
2) I would like the player to get the virtual world in about seconds after he spawn, or login in this case.
3) it printed "Virtualworld set: 0" why? I'm setting it!
Reply
#9

"3) it printed "Virtualworld set: 0" why? I'm setting it!"

Then something is wrong with your reading system, not the function itself.
Reply
#10

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
"3) it printed "Virtualworld set: 0" why? I'm setting it!"

Then something is wrong with your reading system, not the function itself.
This is the reading system from the file:
pawn Код:
public LoadUser_PlayerData(playerid,name[],value[])
{
    INI_String("Password", PlayerInfo[playerid][pPass], 129);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("BizID",PlayerInfo[playerid][BizID]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Money", PlayerInfo[playerid][pMoney]);
    INI_Int("MaskID", PlayerInfo[playerid][pMask]);
    INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
    INI_Int("Ban", PlayerInfo[playerid][pBan]);
    INI_String("IP", PlayerInfo[playerid][pIP], 16);
    INI_Int("Interior", PlayerInfo[playerid][pInterior]);
    INI_Int("VirutalWorld", PlayerInfo[playerid][pVW]);
    INI_Int("Skin", PlayerInfo[playerid][pSkin]);
    INI_Int("Gender", PlayerInfo[playerid][pGender]);
    INI_Int("Age", PlayerInfo[playerid][pAge]);
    INI_Int("Hospital", PlayerInfo[playerid][pHospital]);
    INI_Float("Health", PlayerInfo[playerid][pHealth]);
    INI_Float("Armour", PlayerInfo[playerid][pArmour]);
    INI_Float("PositionX",PlayerInfo[playerid][posX]);
    INI_Float("PositionY",PlayerInfo[playerid][posY]);
    INI_Float("PositionZ",PlayerInfo[playerid][posZ]);
    INI_Float("PositionA",PlayerInfo[playerid][posA]);
    return 1;
}
OnPlayerRequestClass he logins. Then, I'm using:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
Then im spawning the player, and under OnPlayerSpawn SetPlayerVirtualWorld.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)