[Ajuda] SISTEMA DE UP EXP
#7

Quote:
Originally Posted by DesenvolvedorGB
Посмотреть сообщение
Caso tenha algum erro me fale,pois nгo testei.
PHP код:
new EXP[MAX_PLAYERS];
new 
PlayerText:EXP_DRAW[2];
new 
Level[MAX_PLAYERS];
new 
EXPTimer[MAX_PLAYERS]; // Variбvel de armazenamento de Timer.s
//Em OnPlayerSpawn
CriarTextExp(playerid);
//Em OnGameModeInit
EXPTimer[playerid] = SetTimerEx("AtualizarEXPs"600000true"d"playerid);//10 minutos para cada EXP
SetTimer("AtuaizarTextdraw"1000true);
//Em OnPlayerDeath
Exp[killerid]++;
new 
string[128], PrxLvl Level[killerid]+1;
for(new 
020i++)
{
    if(
EXP[killerid] == EXP[playerid])
    {
        
Level[killerid]++;
        
format(stringsizeof(string), "Parabйns, vocк passou para o level %d por ter matado %d players"Level[killerid], EXP[killerid]);
        
SendClientMessage(playerid, -1string);
    }
}
stock CriarTextExp(playerid)
{
    
///////////////////////// Level ////////////////////////////////////////////////
    
EXP_DRAW[0] = CreatePlayerTextDraw(playerid,551.000000291.000000"Level: 0");
    
PlayerTextDrawBackgroundColor(playerid,EXP_DRAW[0], 255);
    
PlayerTextDrawFont(playerid,EXP_DRAW[0], 3);
    
PlayerTextDrawLetterSize(playerid,EXP_DRAW[0], 0.5000001.000000);
    
PlayerTextDrawColor(playerid,EXP_DRAW[0], 65535);
    
PlayerTextDrawSetOutline(playerid,EXP_DRAW[0], 0);
    
PlayerTextDrawSetProportional(playerid,EXP_DRAW[0], 1);
    
PlayerTextDrawSetShadow(playerid,EXP_DRAW[0], 1);
    
//////////////////////////Exp//////////////////////////////////////////////
    
EXP_DRAW[1] = CreatePlayerTextDraw(playerid,551.000000268.000000"Exp: 0/5");
    
PlayerTextDrawBackgroundColor(playerid,EXP_DRAW[1], 255);
    
PlayerTextDrawFont(playerid,EXP_DRAW[1], 1);
    
PlayerTextDrawLetterSize(playerid,EXP_DRAW[1], 0.2800002.100000);
    
PlayerTextDrawColor(playerid,EXP_DRAW[1], -16776961);
    
PlayerTextDrawSetOutline(playerid,EXP_DRAW[1], 0);
    
PlayerTextDrawSetProportional(playerid,EXP_DRAW[1], 1);
    
PlayerTextDrawSetShadow(playerid,EXP_DRAW[1], 1);
    return 
1;
}
stock AtuaizarTextdraw(playerid)
{
    new 
String[5000];
    
format(Stringsizeof(String), "Level: %d"Level[playerid]);
    
PlayerTextDrawSetString(playerid,EXP_DRAW[0], String);
    
PlayerTextDrawShow(playeridEXP_DRAW[0]);
    
format(Stringsizeof(String), "EXP: %d"Exp[playerid]);
    
PlayerTextDrawSetString(playerid,EXP_DRAW[1], String);
    
PlayerTextDrawShow(playeridEXP_DRAW[1]);
        return 
1;
}
forward AtualizarEXPs(playerid);
public 
AtualizarEXPs(playerid)
{
     if(
EXP[playerid] < 10//Verificar para ver se e menor que 10 EXP
     
{
          
EXP[playerid] ++;
          
GameTextForPlayer(playerid,"Voce ganhou + 1 EXP"1000,1);
     }
     else 
// Caso nгo seja menor que 10
     
{
          
Level[playerid]++;
          
EXP[playerid] = 0;
          
SetPlayerScore(playeridScore[playerid]);
           
GameTextForPlayer(playerid,"Voce upou + 1 Level."1000,1);
     }
}
//Em OnPlayerConnect
if(DOF2_IsSet("EXPLEVEL.ini",getPName(playerid))) Level[playerid] = (playerid,DOF2_GetInt("EXPLEVEL.ini",getPName(playerid)));
//Em OnPlayerDisconnect
DOF2_SetInt("EXPLEVEL.ini",getPName(playerid),Level[playerid]); 
mano continъa nгo funcionando tб igual antes nгo aparece nem a textdraw amigo.........
Reply


Messages In This Thread
SISTEMA DE UP EXP - by Dimbalada - 22.08.2017, 19:36
Re: SISTEMA DE UP EXP - by IlanZ - 22.08.2017, 19:58
Re: SISTEMA DE UP EXP - by Dimbalada - 22.08.2017, 20:14
Re: SISTEMA DE UP EXP - by Dimbalada - 22.08.2017, 20:17
Re: SISTEMA DE UP EXP - by Dimbalada - 22.08.2017, 22:11
Re: SISTEMA DE UP EXP - by DesenvolvedorGB - 23.08.2017, 02:25
Re: SISTEMA DE UP EXP - by Dimbalada - 26.08.2017, 03:19
Re: SISTEMA DE UP EXP - by Don_Speed - 26.08.2017, 16:17
Re: SISTEMA DE UP EXP - by Dimbalada - 26.08.2017, 16:25
Re: SISTEMA DE UP EXP - by Don_Speed - 26.08.2017, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)