[Ajuda] Definir o spawn
#3

Altere conforma seu GM
pawn Код:
new Name[MAX_PLAYER_NAME];

public OnPlayerSpawn(playerid)
{
    new file[60],Arma, municao;
    GetPlayerName(playerid, Name,sizeof(Name));
    format(file, sizeof(file), "Contas/%s.ini", Name);
   
    PlayerInfo[playerid][PosX] = DOF2_GetFloat(file, "PosX");
    PlayerInfo[playerid][PosY] = DOF2_GetFloat(file, "PosY");
    PlayerInfo[playerid][PosZ] = DOF2_GetFloat(file, "PosZ");
    SetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
    return 1;
}
CallBack::SalvarPlayer(playerid)
{
    new file[40];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(file, sizeof(file), "Contas/%s.ini", Name);

    if(!DOF2_FileExists(file)) DOF2_CreateFile(file);
   
    GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
    DOF2_SetFloat(file, "PosX", PlayerInfo[playerid][PosX]);
    DOF2_SetFloat(file, "PosY", PlayerInfo[playerid][PosY]);
    DOF2_SetFloat(file, "PosZ", PlayerInfo[playerid][PosZ]);

    DOF2_SaveFile();
    return 1;
}
Reply


Messages In This Thread
Definir o spawn - by Lessk - 09.01.2013, 20:12
Re: Definir o spawn - by GabrielDias_Invision - 09.01.2013, 20:35
Re: Definir o spawn - by mau.tito - 09.01.2013, 20:35
Re: Definir o spawn - by Lessk - 09.01.2013, 20:38
Re: Definir o spawn - by DiReCt hIt - 09.01.2013, 20:42
Re: Definir o spawn - by mau.tito - 09.01.2013, 20:45

Forum Jump:


Users browsing this thread: 1 Guest(s)