#1

So yeah.

I have been working this script for a few days now. I have completed pretty much.
But I seem to can't complete a successful running Save Position system. What I mean is so that player's position would save after log out. I am using the y_ini save system.

Also, another problem is my class selection.
What I mean is the class selection appears after you've register/login.
What I want is for the class selection to automatically appear along with the register or login dialogs.

I would appreciate the help.

+REP
Reply
#2

We can't help you about that.. because 1. We can't see code 2. No one will do it...

You need to do it your self look at tutorials how to save player position... add switch player classes before register system...
Reply
#3

In order to save their positions (I use OnPlayerDisconnect, you can use a timer if you'd prefer)

I use this method (not sure if there's a different method)
pawn Код:
stock find_accPath(playerid)
{
    new
        string[128],
        p_Name[MAX_PLAYER_NAME]
    ;
   
    GetPlayerName(playerid, p_Name, sizeof(p_Name));
    format(string, sizeof(string), "EDIT THIS TO YOUR PATH", p_Name); //Edit this line to your user path (EG: RPMod/Accounts/%s.ini)
     
    return string;
}

public OnPlayerDisconnect(playerid, reason)
{
    if(accLogged[playerid] == true)
    {
        new
            INI:accFile = INI_Open(find_accPath(playerid));
           
        GetPlayerPos(playerid, accInfo[playerid][PosX], accInfo[playerid][PosY], accInfo[playerid][PosZ]);
        GetPlayerFacingAngle(playerid, accInfo[playerid][PosAng]);

        INI_SetTag(accFile, "data");
        INI_WriteFloat(accFile, "X_Pos",        accInfo[playerid][PosX]);
        INI_WriteFloat(accFile, "Y_Pos",        accInfo[playerid][PosY]);
        INI_WriteFloat(accFile, "Z_Pos",        accInfo[playerid][PosZ]);
        INI_WriteFloat(accFile, "Ang_Pos",      accInfo[playerid][PosAng]);
        INI_Close(accFile);
    }
    accLogged[playerid] = false;
    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)