Question
#1

I have created a login /register system in my gm but how do i make that when you do /login you spawn with the skin you have choosen and the position where you where last if sombody know please explane to me

Hope to get some help
Reply
#2

search for it
i remeber that i answered this question 5 times
Reply
#3

Oke thanks alot i go try but if i dont find maby you want to past a link :P
Reply
#4

ok take this code
pawn Код:
/*================================================================================================
                    This Code was created by James_Aex to help Jokerr_mayne
==================================================================================================*/


//=======================================|Includes|================================================//
#include <a_samp>
#include <dini>


public OnPlayerDisconnect(playerid, reason)
{
    new str[128];
    new plname[MAX_PLAYER_NAME]; GetPlayerName(playerid, plname, sizeof(plname));
    format(str, sizeof(str), "Stats/%s.cfg", plname);
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A);
    dini_FloatSet(str, "CrashX", X); dini_FloatSet(str, "CrashY", Y); dini_FloatSet(str, "CrashZ", Z); dini_FloatSet(str, "CrashAngle", A);
    dini_IntSet(str, "CrashInt", GetPlayerInterior(playerid));
    dini_IntSet(str, "Skin", GetPlayerSkin(playerid));
    if(reason == 0)
    {
        dini_IntSet(str, "Crashed", 1);
        return 1;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new str[128];
    new plname[MAX_PLAYER_NAME]; GetPlayerName(playerid, plname, sizeof(plname));
    format(str, sizeof(str), "Stats/%s.cfg", plname);
    if(dini_Exists(str))
    {
        new crashed = dini_Int(str, "Crashed");
        if(crashed == 1)
        {
            SetPlayerPos(playerid, dini_Float(str, "CrashX"), dini_Float(str, "CrashY"), dini_Float(str, "CrashZ"));
            SetPlayerInterior(playerid, dini_Int(str, "CrashInt")); SetPlayerFacingAngle(playerid, dini_Float(str, "CrashAngle"));
            GameTextForPlayer(playerid, "~r~crashed. ~w~returning to your last position.", 7000, 1);
            dini_IntSet(str, "Crashed", 0);
            SetPlayerSkin(playerid, dini_Int(str, "Skin"));
            return 1;

        }
    return 1;
    }
    else
    {
      dini_Create(str);
    }
    return 1;
}
Download Dini HERE
Reply
#5

Cant find what i mean i search player save pos

my question is that when a player disconect his loc is saved and when he log back in he spawns at his disconnect location ?
Reply
#6

change "OnPlayerSawn"
by "OnPlayerLogin" the code that gaves it to you save the player pos and skin when he disconnect
Reply
#7

does it matter that my /register and /login use dudb ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)