[Ajuda] SISTEMA DE UP EXP
#1

PHP код:
new ExpCal[20][] =
{
"5",
"10",
"15",
"20",
"25",
"30",
"35",
"40",
"45",
"50",
"55",
"60",
"65",
"70",
"75",
"80",
"85",
"90",
"95",
"100"
};
new 
Text:Textdraw1[MAX_PLAYERS];
new 
Text:Textdraw0[MAX_PLAYERS];
new 
Level[MAX_PLAYERS];
new 
Exp[MAX_PLAYERS];
public 
OnPlayerSpawn(playerid)
{
    
SetTimerEx("Timer",1000*60,true,"i",playerid);
    
SetTimer("ActualizarTextDraws",true,1000*60);
    
///////////////////////// Level ////////////////////////////////////////////////
    
Textdraw0[playerid] = TextDrawCreate(551.000000291.000000"Level: 0");
    
TextDrawBackgroundColor(Textdraw0[playerid], 255);
    
TextDrawFont(Textdraw0[playerid], 3);
    
TextDrawLetterSize(Textdraw0[playerid], 0.5000001.000000);
    
TextDrawColor(Textdraw0[playerid], 65535);
    
TextDrawSetOutline(Textdraw0[playerid], 0);
    
TextDrawSetProportional(Textdraw0[playerid], 1);
    
TextDrawSetShadow(Textdraw0[playerid], 1);
    
//////////////////////////Exp//////////////////////////////////////////////
    
Textdraw1[playerid] = TextDrawCreate(551.000000268.000000"Exp: 0/5");
    
TextDrawBackgroundColor(Textdraw1[playerid], 255);
    
TextDrawFont(Textdraw1[playerid], 1);
    
TextDrawLetterSize(Textdraw1[playerid], 0.2800002.100000);
    
TextDrawColor(Textdraw1[playerid], -16776961);
    
TextDrawSetOutline(Textdraw1[playerid], 0);
    
TextDrawSetProportional(Textdraw1[playerid], 1);
    
TextDrawSetShadow(Textdraw1[playerid], 1);
        return 
1;
        }
public 
OnPlayerDeath(playeridkilleridreason)
{
Exp[killerid]++;
new 
string[128], PrxLvl Level[killerid]+1;
for(new 
020i++)
{
    if(
Exp[killerid] == ExpCal[i])
    {
        
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);
    }
}
forward ActualizarTextDraws();
public 
ActualizarTextDraws()
{
    new 
String[100];
    for(new 
playerid 0playerid MAX_PLAYERSplayerid ++)
    {
        if(
IsPlayerConnected(playerid))
        {
            
format(Stringsizeof(String), "Level: %d"Level[playerid]);
            
TextDrawSetString(Textdraw0[playerid], String);
            
TextDrawShowForPlayer(playeridTextdraw0[playerid]);
            
format(Stringsizeof(String), "EXP: %d"Exp[playerid]);
            
TextDrawSetString(Textdraw1[playerid], String);
            
TextDrawShowForPlayer(playeridTextdraw1[playerid]);
        }
    }
}
public 
OnPlayerConnect(playerid)
{
if(
dini_Isset("levels.dkn",Nome(playerid))) Level[playerid] = (playerid,dini_Int("levels.dkn",Nome(playerid)));
public 
OnPlayerDisconnect(playeridreason)
{
dini_IntSet("levels.dkn",Nome(playerid),Level[playerid]); 
bom meu sistema de UPAR COM EXP Fazendo kiils e esse mais nгo estб funcionando alguйm pode me dizer o erro?
Reply
#2

Sу mandar o erro
Reply
#3

O erro й que nгo aparace a barra no in game nгo funciono amigo nгo tб funcionando
Reply
#4

Teste em algum gamemode й teste q vera q nгo funciona
Reply
#5

UPZГO...
Reply
#6

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]); 
Reply
#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
#8

Fera , primeiramente o sistema em si funciona Esta armazenando os dados nas variaveis corretamente
Nгo e porque a textdraw nгo aparece que nгo ta funcionando, essas textdraw sгo apenas detalhes .
Reply
#9

Mano sou novato sou novato mesmo sabe entгo n entendendo muito ai eu botei tudo certinho compilei й nгo funciono a textdraw nгo aparece etc..
Reply
#10

Quote:
Originally Posted by Dimbalada
Посмотреть сообщение
Mano sou novato sou novato mesmo sabe entгo n entendendo muito ai eu botei tudo certinho compilei й nгo funciono a textdraw nгo aparece etc..
Ok , volto a tentar te ajudar , quando vocк mesmo tiver interesse no assunto .
Eu mal sei o basico mas quando vou fazer pelo menos tento fazer .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)