21.02.2018, 11:26
Bom estou tentando por um sistema de xp para salvar em Dof2 q eu Adaptei no gm
Quando eu relogo os xp zera tudo
PHP код:
new XP[MAX_PLAYERS];
//-------------------------------------------------------------------------------------------------------------------
enum pInfo
{
pExp,
//-------------------------------------------------------------------------------------------------------------------
DOF2_SetInt(String,"Exp", Player[playerid][pExp]);
Player[playerid][pExp] = DOF2_GetInt(String, "Exp");
//-------------------------------------------------------------------------------------------------------------------
forward Upar(playerid);
public Upar(playerid)
{
new str[256];
XP[playerid] ++;
if(XP[playerid] == 11)
{
new Score = GetPlayerScore(playerid);
SetPlayerScore(playerid, Score+2);
XP[playerid] = 0;
format(str, sizeof(str), "{90EE90}|UP|Vocк juntou 10 experiкncias, e ganhou +2 leveis.(Score atual: %i).", GetPlayerScore(playerid));
SendClientMessage(playerid, -1, str);
PlayerPlaySound(playerid,1149,0.0,0.0,0.0);
GameTextForPlayer(playerid,"~w~Level ~p~UP!",5000,6);
}
else
{
format(str, sizeof(str), "{00EE76}|EXPERIКNCIA|Vocк ganhou +1 de experiкncia! (EXP: %i/10).", XP[playerid]);
GameTextForPlayer(playerid, "~w~+1 ~p~XP", 2000, 1);
SendClientMessage(playerid, -1, str);
PlayerPlaySound(playerid,1139,0.0,0.0,0.0);
GameTextForPlayer(playerid,"+1 XP",5000,6);
}
return true;
}
//-------------------------------------------------------------------------------------------------------------------
dcmd_meuxp(playerid, params[])
{
#pragma unused params
new deustopzissimo[600], deusetop[90];
if(Player[playerid][pLogged] == false)
return SendClientMessage(playerid, COR_ERRO, "ERRO: Vocк nгo estб logado para utilizar este comando!");
new nomep[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomep, sizeof(nomep));
format(deusetop, sizeof(deusetop), "{CDC9C9}Nome: %s\n", nomep);
strcat(deustopzissimo, deusetop);
format(deusetop, sizeof(deusetop), "{4EEE94}Level {FFFFFF}atual: %d\n", GetPlayerScore(playerid));
strcat(deustopzissimo, deusetop);
format(deusetop, sizeof(deusetop), "{6B8E23}Total de XP: (%d/10).\n", XP[playerid], DOF2_GetString(deusetop, "Exp"));
strcat(deustopzissimo, deusetop);
ShowPlayerDialog(playerid, DIALOG_CREDITOS, DIALOG_STYLE_MSGBOX, "{FFFFFF}» Seu level", deustopzissimo, "Sair", "");
return 1;
}
https://imgur.com/a/xOOmm