09.03.2015, 02:56
(
Последний раз редактировалось StarPeens; 10.03.2015 в 00:13.
Причина: cfc
)
____
Isso me ajudou a converter meu sistema:
http://forum.sa-mp.com/showthread.ph...svendando+dof2 Ex: mysql_GetInt equivale em DOF2 а DOF2_GetInt... Nгo й dificil converter, sу prestar atenзгo... Erros na conversгo postar aqui que ajudo |
DOF2_SetFloat("accounts","PosX",SpielerInfo[playerid][PosX],"Name",GetName(playerid));
stock SavePlayer(playerid){
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)){
if(GetPVarInt(playerid,"Eingeloggt") == 1){
new fFile[64];
format(fFile, sizeof(fFile), "accounts/%s.ini", GetName(playerid));//Altere esse caminho, caso necessбrio.
GetPlayerPos(playerid, SpielerInfo[playerid][PosX], SpielerInfo[playerid][PosY], SpielerInfo[playerid][PosZ]);
//Ints
DOF2_SetInt(fFile, "Level", GetPlayerScore(playerid));
DOF2_SetInt(fFile, "Items_MED", GiveItem[playerid][MED_KIT]);
DOF2_SetInt(fFile, "Items_CZ550", GiveItem[playerid][CZ550]);
DOF2_SetInt(fFile, "Items_M4A1", GiveItem[playerid][M4A1]);
DOF2_SetInt(fFile, "Items_Bandage", GiveItem[playerid][BANDAGE]);
DOF2_SetInt(fFile, "Items_FullBottle", GiveItem[playerid][FULL_BOTTLE]);
DOF2_SetInt(fFile, "Items_Map", GiveItem[playerid][MAP]);
DOF2_SetInt(fFile, "Items_Items_EmptyBottle", GiveItem[playerid][EMPTY_BOTTLE]);
DOF2_SetInt(fFile, "Backpack", SpielerInfo[playerid][Backpack]);
DOF2_SetInt(fFile, "AliveMinutes", SpielerInfo[playerid][pAliveMinutes]);
DOF2_SetInt(fFile, "AliveSeconds", SpielerInfo[playerid][pAliveSeconds]);
DOF2_SetInt(fFile, "Blood", SpielerInfo[playerid][pBlood]);
DOF2_SetInt(fFile, "Temparatur", SpielerInfo[playerid][pTemparatur1]);
DOF2_SetInt(fFile, "Live", SpielerInfo[playerid][pLive]);
DOF2_SetInt(fFile, "Durst", SpielerInfo[playerid][pDurst]);
DOF2_SetInt(fFile, "Banned", SpielerInfo[playerid][pBan]);
DOF2_SetInt(fFile, "MapUsed", SpielerInfo[playerid][isMapUsed]);
DOF2_SetInt(fFile, "AdminPlayer", SpielerInfo[playerid][isAdmin]);
//Floats
DOF2_SetFloat(fFile, "Backpack", SpielerInfo[playerid][Backpack]);
DOF2_SetFloat(fFile, "PosX", SpielerInfo[playerid][PosX]);
DOF2_SetFloat(fFile, "PosY", SpielerInfo[playerid][PosY]);
DOF2_SetFloat(fFile, "PosZ", SpielerInfo[playerid][PosZ]);
//Strings
DOF2_SetString(fFile, "BanReason", SpielerInfo[playerid][pBanGrund]);
DOF2_SetString(fFile, "BanTime", SpielerInfo[playerid][pBanTime]);
DOF2_SetString(fFile, "BanDate", SpielerInfo[playerid][pBanDate]);
DOF2_SetString(fFile, "BanIP", SpielerInfo[playerid][pBanIP]);
}
}
return 1;
}
stock LoadPlayer(playerid){
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)){
new fFile[64];
format(fFile, sizeof(fFile), "accounts/%s.ini", GetName(playerid));//Altere esse caminho, caso necessбrio.
GiveItem[playerid][MED_KIT] = DOF2_GetInt(fFile, "Items_MED");
GiveItem[playerid][CZ550] = DOF2_GetInt(fFile, "Items_CZ550");
GiveItem[playerid][M4A1] = DOF2_GetInt(fFile, "Items_M4A1");
GiveItem[playerid][BANDAGE] = DOF2_GetInt(fFile, "Items_Bandage");
GiveItem[playerid][FULL_BOTTLE] = DOF2_GetInt(fFile, "Items_FullBottle");
GiveItem[playerid][MAP] = DOF2_GetInt(fFile, "Items_Map");
GiveItem[playerid][EMPTY_BOTTLE] = DOF2_GetInt(fFile, "Items_EmptyBottle", "Name", GetName(playerid));
SpielerInfo[playerid][pLevel] = DOF2_GetInt(fFile, "Level");
SpielerInfo[playerid][Backpack] = DOF2_GetInt(fFile, "Backpack");
SpielerInfo[playerid][pAliveMinutes] = DOF2_GetInt(fFile, "AliveMinutes");
SpielerInfo[playerid][pAliveSeconds] = DOF2_GetInt(fFile, "AliveSeconds");
SpielerInfo[playerid][pBlood] = DOF2_GetInt(fFile, "Blood");
SpielerInfo[playerid][pTemparatur1] = DOF2_GetInt(fFile, "Temparatur");
SpielerInfo[playerid][pLive] = DOF2_GetInt(fFile, "Live");
SpielerInfo[playerid][pDurst] = DOF2_GetInt(fFile, "Durst");
SpielerInfo[playerid][pBan] = DOF2_GetInt(fFile, "Banned");
SpielerInfo[playerid][isMapUsed] = DOF2_GetInt(fFile, "MapUsed");
SpielerInfo[playerid][isAdmin] = DOF2_GetInt(fFile, "AdminPlayer");
SpielerInfo[playerid][PosX] = DOF2_GetFloat(fFile, "PosX");
SpielerInfo[playerid][PosY] = DOF2_GetFloat(fFile, "PosY");
SpielerInfo[playerid][PosZ] = DOF2_GetFloat(fFile, "PosZ");
}
return 1;
}
new xRL[40];
format(xRL, sizeof(xRL), "Contas/%s.ini", GetName(playerid)); // Mude de acordo com sua pasta.
DOF2_SetFloat(xRL, "PosX", SpielerInfo[playerid][PosX]);
DOF2_SaveFile(); // Usada para salvar o arquivo
GiveItem[playerid][EMPTY_BOTTLE] = DOF2_GetInt(fFile, "Items_EmptyBottle", "Name", GetName(playerid));
@Los
pawn Код:
|
GiveItem[playerid][EMPTY_BOTTLE] = DOF2_GetInt(fFile, "Items_EmptyBottle");
GiveItem[playerid][EMPTY_BOTTLE] = DOF2_GetInt(fFile, "Items_EmptyBottle");
GetName(playerid),GetName(playerid),DOF2_GetString("accounts","BanReason","Name",GetName(playerid)),DOF2_GetString("accounts","BanTime","Name",GetName(playerid)),DOF2_GetString("accounts","BanDate","Name",GetName(playerid)),DOF2_GetString("accounts","BanIP","Name",GetName(playerid)));
SpielerInfo[playerid][pBan] = DOF2_GetInt("accounts","Banned","Name",GetName(playerid));