How Do You save Player Postion With Y_INI? -
Mike97300 - 14.06.2012
Well, I can't find a tutorials any where, there's one, but it doesn't work, could someone help?
Re: How Do You save Player Postion With Y_INI? -
ReneG - 14.06.2012
What's wrong with ******?
AW: How Do You save Player Postion With Y_INI? -
Mike97300 - 14.06.2012
Yes, I tried that tutorial, and it saved etc. and it did nothing.
Re : How Do You save Player Postion With Y_INI? -
vernz - 15.06.2012
Top of your script:
pawn Код:
new
Float: PosX[MAX_PLAYERS],
Float: PosY[MAX_PLAYERS],
Float: PosZ[MAX_PLAYERS],
Float: Angle[MAX_PLAYERS]
Under OnPlayerDisconnect:
pawn Код:
GetPlayerPos(playerid,PosX[playerid],PosY[playerid],PosZ[playerid]);
GetPlayerFacingAngle(playerid,Angle[playerid]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteFloat(File,"PositionX",PosX[playerid]);
INI_WriteFloat(File,"PositionY",PosY[playerid]);
INI_WriteFloat(File,"PositionZ",PosZ[playerid]);
INI_WriteFloat(File,"Angle",Angle[playerid]);
INI_Close(File);
Under OnPlayerSpawn:
pawn Код:
if(PosX[playerid] !=0 && PosY[playerid] !=0 && PosZ[playerid] !=0 && Angle[playerid] != 0)
{
SetPlayerPos(playerid,PosX[playerid],PosY[playerid],PosZ[playerid]);
SetPlayerFacingAngle(playerid,Angle[playerid]);
}
Under your Login System:
pawn Код:
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin],PosX[playerid],PosY[playerid],PosZ[playerid],Angle[playerid], 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
Under your load function:
pawn Код:
INI_Float("PositionX",PosX[playerid]);
INI_Float("PositionY",PosY[playerid]);
INI_Float("PositionZ",PosZ[playerid]);
INI_Float("Angle",Angle[playerid]);
This is how it works for me.
Re: How Do You save Player Postion With Y_INI? -
Mike97300 - 15.06.2012
This is a newb question, but Load Function? where is that?
Re: How Do You save Player Postion With Y_INI? -
Blunt - 15.06.2012
Quote:
Originally Posted by Mike97300
This is a newb question, but Load Function? where is that?
|
Under this function.
public LoadUser_data(playerid,name[],value[])
Re: How Do You save Player Postion With Y_INI? -
Mike97300 - 15.06.2012
I'm getting these errors now.
pawn Код:
C:\Users\GTW\BaseNorton V2\gamemodes\Gamemode.pwn(143) : error 001: expected token: ";", but found "-identifier-"
Line 143
Re: How Do You save Player Postion With Y_INI? -
Kindred - 15.06.2012
Where is Main() placed? Plus, I honestly have no idea what that is, or what it does. Seems pretty useless.
Re: How Do You save Player Postion With Y_INI? -
Mike97300 - 15.06.2012
It's here
pawn Код:
//-----[Enum Playerinfo]-----
enum pInfo
{
Password,
Cash,
Kills,
Deaths,
Adminlevel,
Pskin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new QuizAnswers[MAX_PLAYERS];
new LSPDLeader[MAX_PLAYERS];
new LSPDMember[MAX_PLAYERS];
new Float: PosX[MAX_PLAYERS],
Float: PosY[MAX_PLAYERS],
Float: PosZ[MAX_PLAYERS],
Float: Angle[MAX_PLAYERS]
main() { }
public OnGameModeInit()
{
Create3DTextLabel("24/7", COLOR_RED, 1833.4626,-1841.8864,13.5781, 40.0, 0, 0);
AddStaticPickup(1318, 1, 240.5396,117.6052,1003.2257, -1);//lspd door
AddStaticPickup(1318, 1, 252.1050,109.2321,1003.2188, -1);//lspd door
Re: How Do You save Player Postion With Y_INI? -
Mike97300 - 15.06.2012
Never mind, it was fixed, the last line wasn't ended -.-