23/10/2023 09:22
N sei se tem algo a ver com tag mismatch do getfloat, mas testa isso ai
Código PHP:
stock pName(playerid) // Pegar o nickname do player
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
return Nome;
}
stock Arquivo(playerid) // Diretório de contas
{
new String[100];
format(String, 100, "Contas/%s.ini", pName(playerid));
return String;
}
stock sDados(playerid) // Salvar os dados do player
{
if(DOF2_FileExists(Arquivo(playerid)))
{
new Float:Vida, Float:Colete, Arma, Municao, String[20];
DOF2_SetInt(Arquivo(playerid), "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(Arquivo(playerid), "Score", GetPlayerScore(playerid));
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
DOF2_SetFloat(Arquivo(playerid), "Vida", Vida);
DOF2_SetFloat(Arquivo(playerid), "Colete", Colete);
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, Arma, Municao);
format(String, 20, "Arma%d", i);
DOF2_SetInt(Arquivo(playerid), String, Arma);
format(String, 20, "Municao%d", i);
DOF2_SetInt(Arquivo(playerid), String, Municao);
}
DOF2_SaveFile();
return 1;
}
return 0;
}
stock cDados(playerid) // Carregar os dados do player
{
new Float:Vida, Float:Colete, Arma, Municao, String[20];
GivePlayerMoney(playerid, DOF2_GetInt(Arquivo(playerid), "Dinheiro"));
SetPlayerScore(playerid, DOF2_GetInt(Arquivo(playerid), "Score"));
Vida = Float:DOF2_GetFloat(Arquivo(playerid), "Vida");
Colete = Float:DOF2_GetFloat(Arquivo(playerid), "Colete");
SetPlayerHealth(playerid, Vida);
SetPlayerArmour(playerid, Colete);
ResetPlayerWeapons(playerid);
for(new i = 0; i < 13; i++)
{
format(String, 20, "Arma%d", i);
Arma = DOF2_GetInt(Arquivo(playerid), String);
format(String, 20, "Municao%d", i);
Municao = DOF2_GetInt(Arquivo(playerid), String);
GivePlayerWeapon(playerid, Arma, Municao);
}
}
stock GivePlayerWeaponKU(playerid, Gun, Ammo)
{
new gunname[32];
GivePlayerWeapon(playerid, Gun, Ammo);
GetWeaponName(Gun, gunname, sizeof(gunname));
SetPVarInt(playerid, gunname, GetPVarInt(playerid, gunname) +Ammo);
}