What am I doing wrong?[HELP ME]
#7

Sorry, I forgot to add GetPlayerPos function.
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Positions\\%s.ini", pname);//leader the name of your folder in scriptfiles
    if(!dini_Exists(file))
    dini_Create(file);
    new Float:x, Float:y, Float:z;
    GetPlayerPos( playerid, x, y, z );
    dini_FloatSet( file, "PosX", x );
        dini_FloatSet( file, "PosY", y );
        dini_FloatSet( file, "PosZ", z );
    return 1;
}

public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Positions\\%s.ini", pname);//leader the name of your folder in scriptfiles
if( !dini_Exists( file ) ) return 0; // file doesn't exist, don't set their pos.
SetPlayerPos(playerid, dini_Int(file, "Pos"));
return 1;
}
Reply


Messages In This Thread
What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 05:43
Re: What am I doing wrong?[HELP ME] - by Grim_ - 22.12.2010, 05:47
Re: What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 05:54
Re: What am I doing wrong?[HELP ME] - by Grim_ - 22.12.2010, 05:57
Re: What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 05:58
Re: What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 06:05
Re: What am I doing wrong?[HELP ME] - by Grim_ - 22.12.2010, 06:07
Re: What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 06:12
Re: What am I doing wrong?[HELP ME] - by [JnA]DukeNukem - 22.12.2010, 06:15
Re: What am I doing wrong?[HELP ME] - by Grim_ - 22.12.2010, 06:18

Forum Jump:


Users browsing this thread: 1 Guest(s)