02.09.2014, 18:15
Olб, criei um sistema de up level agora pouco, e gostaria de criar um textdraw com o tempo que falta para o player upar, o sistema nгo tem nenhum erro, salva os levels e os exps na pasta da acc do player e etc. Eu queria umt extdraw no canto da tela com o tempo que falta para ganhar 1 exp, o tempo para ganhar 1 exp й 12 minutos, aн no textdraw iria comeзar no 12:00 minutos ate chegar no 0:00 (Iria aparecer os segundos tambйm) e upar, quando upasse 1 exp voltasse pro 12 denovo.
Abaixo o sistema:
Um exemplo abaixo:
Abaixo o sistema:
PHP код:
////Topo do GM
forward AddExp(playerid);
///OnPlayerConnect
SetTimer("AddExp",12000,1);
///Final do GM
public AddExp(playerid){
new file[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, name);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
new String[120];
Exp[playerid]++;
format(String, sizeof(String), "| UP | Vocк ganhou +1 ponto de experiкncia [%d/5]!",Exp[playerid]);
SendClientMessage(playerid, -1, String);
PlayerPlaySound(playerid, 1057, x, y ,z);
GameTextForPlayer(playerid, "UP", 2000, 6);
if(DOF2_FileExists(file)){
DOF2_SetInt(file, "Exp",Exp[playerid]);
DOF2_SaveFile();
}
if(Exp[playerid] == 5){
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
format(String, sizeof(String), "| UP | Vocк juntou 5 pontos de experiкncia e ganhou +1 level [%d]", GetPlayerScore(playerid));
SendClientMessage(playerid, -1, String);
Exp[playerid] = 0;
if(DOF2_FileExists(file)){
DOF2_SetInt(file, "Level", GetPlayerScore(playerid));
DOF2_SetInt(file, "Exp",0);
DOF2_SaveFile();
}
}
}
