[Pedido] Sistema de level
#1

Olб galera, gostaria de um sistema de level nгo sei se й simples ou nгo.

- Cada 10m online, ganha uma EXPERIENCIA.
- Cada 5 experiencia, ganha um LEVEL.

- Comandos: /meulevel
Monstrando quantas experiencia tem, eo level.

- ComandosAdmin: /verlevel (player)
Reply
#2

Peguei esse sistema e dei uma modificada pro jeito que vocк quer..
os crйditos do criador

Sistema de Level UP/HorasJogadas/Salario
----------------LucasTotola---------------

PHP код:
#include <a_samp>
#include <DOF2>
#define LEVEL                  "Level/%s.ini"
#define SEGUNDOSLEVEL          600
enum Info
{
    
pSegundos,
    
pLevel,
    
pExp
};
new 
PlayerInfo[MAX_PLAYERS][Info];
new 
segundos;
public 
OnFilterScriptInit()
{
    
segundos SetTimer("SegundoaMais",1000,1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
KillTimer(segundos);
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    
format(arquivosizeof(arquivo), LEVELplayername);
    if(
DOF2_FileExists(arquivo))
    {
        
DOF2_SetInt(arquivo"Segundos"PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo"Level"PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo"Exp"PlayerInfo[playerid][pExp]);
        
DOF2_SaveFile();
    }
    else
    {
        
DOF2_CreateFile(arquivo);
        
DOF2_SetInt(arquivo"Segundos"PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo"Level"PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo"Exp"PlayerInfo[playerid][pExp]);
        
DOF2_SaveFile();
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    
format(arquivosizeof(arquivo), LEVELplayername);
    
PlayerInfo[playerid][pSegundos] = DOF2_GetInt(arquivo"Segundos");
    
PlayerInfo[playerid][pLevel] = DOF2_GetInt(arquivo"Level");
    
PlayerInfo[playerid][pExp] = DOF2_GetInt(arquivo"Exp");
    return 
1;
}
forward SegundoaMais();
public 
SegundoaMais()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
PlayerInfo[i][pSegundos] ++;
        if(
PlayerInfo[i][pSegundos] >= SEGUNDOSLEVEL)
        {
            
PlayerInfo[i][pSegundos] = 0;
            
LevelUP(i);
        }
    }
    return 
1;
}
LevelUP(playerid)
{
    
PlayerInfo[playerid][pLevel] +=1;
    if(
PlayerInfo[playerid][pLevel] >= 5)
    {
        
PlayerInfo[playerid][pLevel] = 0;
        
PlayerInfo[playerid][pExp] += 1;
        
GameTextForPlayer(playerid"~w~Level ~p~UP"20001);
    }
    
GameTextForPlayer(playerid"~w~+1 ~p~EXP"15001);
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/meulevel"cmdtext) == 0)
    {
        new 
string[256];
        
format(stringsizeof(string), "Seu level: %i"PlayerInfo[playerid][pExp]);
        
SendClientMessage(playerid0xAF0000FFstring);
        return 
1;
    }
    return 
0;

Reply
#3

Basta adaptar.

----------

Procure sempre:
Reply
#4

Como que coloca esse sistema ? tipo, sou novo nisso. ai nгo sei a pasta que crita no scriptfiles e tals.
Reply
#5

Quote:
Originally Posted by daniel079
Посмотреть сообщение
Como que coloca esse sistema ? tipo, sou novo nisso. ai nгo sei a pasta que crita no scriptfiles e tals.
Pasta "Level". Somente.
Reply
#6

los, esse sistema ta bugado, n entra o /meulevel n upa e tals
Reply
#7

Quote:
Originally Posted by daniel079
Посмотреть сообщение
los, esse sistema ta bugado, n entra o /meulevel n upa e tals
O comando /meulevel nгo existe. Como eu disse, terбs que adaptar ou fazer o seu prуprio.

---------------------------

Eu recomendo fortemente que leia as regras antes de postar ou criar um novo tуpico.

Cheers!
Reply
#8

Tem como vc criar um pramin? pf com os negocio que eu comentei a cima
Reply
#9

o meu sistema nгo funcionou ?

Coloque isto no script do Lуs
Quote:

CMD:meulevel(playerid)
{
new string[128];
format(string, 128, "Level: %d", Level[playerid]);
return SCM(playerid, -1, string);
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)