Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Eventos
- event onLoad(){
- database.execute("CREATE TABLE IF NOT EXISTS Niveis(
- Steamid VARCHAR(17) PRIMARY KEY,
- Nome VARCHAR(255),
- Tempo INT NOT NULL DEFAULT 0,
- Level TINYINT NOT NULL DEFAULT 0,
- Progresso INT NOT NULL DEFAULT 0
- );");
- }
- event onPlayerJoined(player){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- if(DB.count == 0){
- database.execute("INSERT INTO Niveis (Steamid, Nome) VALUES ('" + player.id + "', '" + player.name + "')");
- }
- }
- event onInterval(60){
- foreach(player in server.players){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- if(DB.count != 0 ){
- database.execute("UPDATE Niveis SET Tempo = Tempo + 1 WHERE Steamid = '" + player.id + "'");
- database.execute("UPDATE Niveis SET Progresso = Progresso + 1 WHERE Steamid = '" + player.id + "'");
- }
- }
- }
- event onInterval(30){
- foreach(player in server.players){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- DB = DB[0];
- pProgresso = DB[4];
- pLevel = DB[3];
- pProgresso = toNumber(pProgresso);
- if(pProgresso == 60 or pProgresso > 60){
- database.execute("UPDATE Niveis SET Progresso = Progresso - 60 WHERE Steamid = '" + player.id + "'");
- database.execute("UPDATE Niveis SET Level = Level + 1 WHERE Steamid = '" + player.id + "'");
- player.message("<color=#00fbff>[Nível] </color><color=#ffffff>Você upou</color><color=#00e85d> 1 nível</color><color=#ffffff> e recebeu seu salário!</color>");
- if(player.hasPermission("vip")){
- player.experience = player.experience + 800;
- player.message("<color=#00fbff>[Nível] </color><color=#ffffff>Você recebeu o seu </color><color=#f0e113>salário VIP</color><color=ffffff>.</color>");
- }
- player.message("<color=#00fbff>[Nível] </color><color=#ffffff>Você antes era nível </color><color=#f0e113>" + pLevel + "</color><color=#ffffff>.</color>");
- if(player.hasPermission("mendigo")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("entregadordejornal")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("entregadordepizza")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("taxista")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("gari")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("coveiro")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("fotografo")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("carteiro")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("lixeiro")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("eletricista")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("padre")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("pescador")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("motoristadeonibus")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("fazendeiro")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("minerador")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("caçador")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("reparadorderadares")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("reparadordeturbinas")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("caminhoneiro")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("transportadordeconcreto")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("leitero")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("lenhador")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("transportadordeminérios")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("cientista")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("piloto")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("segurançadecarroforte")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("motoristadecarroforte")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("transportadordecombustíveis")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("maquinista")){
- player.experience = player.experience + 150;
- }
- if(player.hasPermission("capitaonautico")){
- player.experience = player.experience + 150;
- }
- }
- }
- }
- // Comandos
- command nivel(){
- execute(){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- DB = DB[0];
- pLevel = DB[3];
- pTempo = DB[2];
- pProgresso = DB[4];
- player.message("Nível: " + pLevel + ".");
- }
- }
- command playtime(){
- execute(){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- DB = DB[0];
- pTempo = DB[2];
- player.message("Você tem " + pTempo + " minutos de jogo em nosso servidor.");
- }
- }
- command up(){
- execute(){
- DB = database.execute("SELECT * FROM Niveis WHERE Steamid = '" + player.id + "'");
- DB = DB[0];
- pTempo = DB[2];
- pProgresso = DB[4];
- player.message("Você está a " + pProgresso + "% de upar.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement