Sistema de XP + Level -
JuninTJF - 27.12.2015
Bom estou com um problema no sistema de XP na Public OnPlayerUpdate .
Cуdigo Abaixo .
PHP код:
if(!IsPlayerConnected(playerid)) return 0;
format(String, sizeof(String), "%.0f%", (floatdiv(Exp[playerid], TExp[playerid]) * 100.0));
PlayerTextDrawSetString(playerid, ExpDraw[7], String);
format(String, sizeof(String), "%.0f%", (floatdiv(Server[Kills], 13) * 100.0));
PlayerTextDrawSetString(playerid, ExpDraw[8], String);
PlayerTextDrawShow(playerid, ExpDraw[7]);
format(String, sizeof(String), "~w~Nivel: ~y~%d", GetPlayerScore(playerid));
PlayerTextDrawSetString(playerid, ExpDraw[1], String);
PlayerTextDrawShow(playerid, ExpDraw[1]);
SetProgressBarValue(ExpBar[playerid][0],(floatdiv(Exp[playerid], TExp[playerid]) * 100.0));
ShowProgressBarForPlayer(playerid, ExpBar[playerid][0]);
SetProgressBarValue(ExpBar[playerid][1],(floatdiv(Server[Kills], 13) * 100.0));
ShowProgressBarForPlayer(playerid, ExpBar[playerid][1]);
if(Server[Kills] == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "|| INFO || Fizes-te 1 kills e ganhas-te +2EXP !");
Exp[playerid] = Exp[playerid] + 2;
Server[Kills] = 0;
}
new H, M, S;
gettime(H, M, S);
if(M == 00 && S == 00)
{
format(String, sizeof(String), "~b~ Sгo ~r~%d ~b~Horas e ~r~%d ~b~Minutos\n ~r~HORA DO PAYDAY!", H, M);
GameTextForAll(String, 1500, 6);
if(Online[playerid] != 1) return SendClientMessage(playerid, COLOR_ORANGE, "|| INFO || Nгo recebeste o payday. Razгo: Nгo estбs online б mais de 30minutos.");
Exp[playerid]+=1;
if(TExp[playerid] == Exp[playerid] || Exp[playerid] > TExp[playerid])
{
GetPlayerScore(i)++;
TExp[playerid] = GetPlayerScore(i)*6;
Exp[playerid] = 0;
format(String, sizeof(String), "|| INFO || Parabйns, subiste para nivel %d e tens %d/%d de experiкncia", GetPlayerScore(i), Exp[playerid], TExp[playerid]);
SendClientMessage(playerid, COLOR_BLUE, String);
SalvarPlayer(playerid);
}
}
O Erro estб dizendo que nгo foi definido o String , Mais eu tenho no Global jб definido .
E Tambйm gostaria de saber como й que eu posso ta chamando essa Textdraw .
PHP код:
PlayerTextDrawSetString(playerid, ExpDraw[7], String);
Re: Sistema de XP + Level -
Caiton - 27.12.2015
Quote:
Originally Posted by JuninTJF
Bom estou com um problema no sistema de XP na Public OnPlayerUpdate .
Cуdigo Abaixo .
PHP код:
if(!IsPlayerConnected(playerid)) return 0;
format(String, sizeof(String), "%.0f%", (floatdiv(Exp[playerid], TExp[playerid]) * 100.0));
PlayerTextDrawSetString(playerid, ExpDraw[7], String);
format(String, sizeof(String), "%.0f%", (floatdiv(Server[Kills], 13) * 100.0));
PlayerTextDrawSetString(playerid, ExpDraw[8], String);
PlayerTextDrawShow(playerid, ExpDraw[7]);
format(String, sizeof(String), "~w~Nivel: ~y~%d", GetPlayerScore(playerid));
PlayerTextDrawSetString(playerid, ExpDraw[1], String);
PlayerTextDrawShow(playerid, ExpDraw[1]);
SetProgressBarValue(ExpBar[playerid][0],(floatdiv(Exp[playerid], TExp[playerid]) * 100.0));
ShowProgressBarForPlayer(playerid, ExpBar[playerid][0]);
SetProgressBarValue(ExpBar[playerid][1],(floatdiv(Server[Kills], 13) * 100.0));
ShowProgressBarForPlayer(playerid, ExpBar[playerid][1]);
if(Server[Kills] == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "|| INFO || Fizes-te 1 kills e ganhas-te +2EXP !");
Exp[playerid] = Exp[playerid] + 2;
Server[Kills] = 0;
}
new H, M, S;
gettime(H, M, S);
if(M == 00 && S == 00)
{
format(String, sizeof(String), "~b~ Sгo ~r~%d ~b~Horas e ~r~%d ~b~Minutos\n ~r~HORA DO PAYDAY!", H, M);
GameTextForAll(String, 1500, 6);
if(Online[playerid] != 1) return SendClientMessage(playerid, COLOR_ORANGE, "|| INFO || Nгo recebeste o payday. Razгo: Nгo estбs online б mais de 30minutos.");
Exp[playerid]+=1;
if(TExp[playerid] == Exp[playerid] || Exp[playerid] > TExp[playerid])
{
GetPlayerScore(i)++;
TExp[playerid] = GetPlayerScore(i)*6;
Exp[playerid] = 0;
format(String, sizeof(String), "|| INFO || Parabйns, subiste para nivel %d e tens %d/%d de experiкncia", GetPlayerScore(i), Exp[playerid], TExp[playerid]);
SendClientMessage(playerid, COLOR_BLUE, String);
SalvarPlayer(playerid);
}
}
O Erro estб dizendo que nгo foi definido o String , Mais eu tenho no Global jб definido .
E Tambйm gostaria de saber como й que eu posso ta chamando essa Textdraw .
PHP код:
PlayerTextDrawSetString(playerid, ExpDraw[7], String);
|
Jб vai copiar a GT ? kkkk tu й rapido em
Re: Sistema de XP + Level -
[BOPE]Seu._.Madruga - 27.12.2015
Cara na OnPlayerUpdate nгo й necessбrio usar isto e й consideravelmente errado!
Pois a OnPlayerUpdate й carregada em millisegundos, use um TimerEx!
Re: Sistema de XP + Level -
JuninTJF - 27.12.2015
Quote:
Originally Posted by Caiton
Jб vai copiar a GT ? kkkk tu й rapido em
|
Meu servidor й de RPG