[FilterScript] [FS]: Nitrous System
#1

Introduзгo
Bom, hoje no trabalho, tive uma ideia que eu achei relativamente
boa, pois nunca vi ela rodando em mente em algum servidor.

Bom, ela se consiste em um sistema de nitro, muito simples, que
por sinal й parecido com o sistema de o Need For Speed.



Como funciona?
O sistema funciona da seguinte maneira, vocк aperta ALT, aparece uma barra de progresso
indicando seu nitro ai quando a barra se esvazia, seu nitro acaba, ai tem que esperar ela
encher novamente.

Para encher novamente vocк deve estar em um veiculo, ela nгo enche se estiver fora do veiculo.

Para entender melhor:
http://www.youtube.com/watch?v=lhpIZ...ature=*********



Crйditos
Bom, o sistema foi totalmente elaborado por min, mais tive que utilizar uma include,
para fazer a barra de progresso, ela se chama Progress Bar, criada pelo nosso amigo
Toribio (link).


Download
pawn Код:
#include a_samp
#include progress


#if !defined CallBack
    #define CallBack::%0(%1)    %0(%1); public %0(%1)
#endif

#define MAX_INT     2

new
    Bar:Barra[ MAX_PLAYERS],
    Nitro[MAX_PLAYERS char],
    PlayersConectados,
    Text:TextDraw
;

public OnPlayerConnect(playerid){

    Barra[playerid] = CreateProgressBar(505.00, 380.00, 109.50, 9.19, 0x00BFFFFF, 100.0);
    Nitro{playerid} = 100;
    return PlayersConectados++, true;
}


public OnPlayerDisconnect(playerid, reason){
    return PlayersConectados--, true;
}

public OnFilterScriptInit(){

    printf (#===========================);
    printf (#Advanced Nitrous system);
    printf (#Criado por: SuYaNW. Dacio);
    printf (#- Carregado!);
    printf (#===========================);
   
    SetTimer("UpdateNos",  MAX_INT * 1000,  true);
   
   
    TextDraw = TextDrawCreate(501.000000, 366.000000, "Nitro:");
    TextDrawBackgroundColor(TextDraw, 16777215);
    TextDrawFont(TextDraw, 1);
    TextDrawLetterSize(TextDraw, 0.590000, 1.200000);
    TextDrawColor(TextDraw, 255);
    TextDrawSetOutline(TextDraw, 1);
    TextDrawSetProportional(TextDraw, 1);
    return true;
}



public OnPlayerEnterVehicle(playerid, vehicleid){
    if(zNitro(vehicleid)){
        AddVehicleComponent(vehicleid, 1010);
    }
    return true;
}

public OnPlayerExitVehicle(playerid, vehicleid){
    if(zNitro(vehicleid)){
        HideProgressBarForPlayer(playerid, Barra[playerid]);
        TextDrawHideForPlayer(playerid, TextDraw);
    }
    return true;
}

public OnPlayerSpawn(playerid){
    Nitro{playerid} = 100;
   
    return true;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(IsPlayerInAnyVehicle(playerid) && zNitro(GetPlayerVehicleID(playerid)) && (oldkeys & 4)) {
   
       
        TextDrawShowForPlayer(playerid, TextDraw);
        if(Nitro{playerid} != 0){
            RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
           
            Nitro{playerid} -= 5;
           
            SetProgressBarValue(Barra[playerid], Nitro{playerid});
            UpdateProgressBar(Barra[playerid], playerid);
            ShowProgressBarForPlayer(playerid, Barra[playerid]);
        }else{
            RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        }
    }
   
    return true;
}


CallBack::UpdateNos(vehicleid){
    static
        Interator
    ;
    for(Interator = 0; Interator != PlayersConectados; ++Interator){
        if(IsPlayerInAnyVehicle(Interator)){
            if(Nitro{Interator} < 100){
                Nitro{Interator} += 5;

                SetProgressBarValue(Barra[Interator], Nitro{Interator});
                UpdateProgressBar(Barra[Interator], Interator);
                ShowProgressBarForPlayer(Interator, Barra[Interator]);
            }
        }
    }
    return true;
}


CallBack::zNitro(vehicleid){
   switch(GetVehicleModel(vehicleid))
   {
     case
          444, 581, 586, 481, 509, 446, 556, 443, 452, 453, 454, 472,
          473, 484, 493, 495, 462, 463, 468, 521, 522, 417, 425, 447,
          488, 497, 501, 548, 563, 406, 520, 539, 553, 557, 573, 460,
          464, 476, 511, 512, 577, 592, 471, 448, 461, 523, 510, 487,
          430, 465, 469, 513, 593, 419:
          return false ;
   }
   return true ;
}
Reply
#2

Muito Bom, +rep!

@Off

Alguйm ae sabe em qual opзгo de escolhas de objeto do MTA estб as portas?
Reply
#3

Muito bom, poderia disponibilizar a include progress?
Reply
#4

Boa Garfield, acho que essa ideia foi roubada de mim ein... -n.
Reply
#5

o que eu vi por cima ta bom, mas depois quando eu chegar do uma olhada bem de vagar e dou um @edit
Reply
#6

Legal gostei, parabйns
Reply
#7

Quote:
Originally Posted by Bruno Bastos
Посмотреть сообщение
Muito bom, poderia disponibilizar a include progress?
AQUI
Reply
#8

boa sobre quem quiser a include progress mais o create progress visite o link do toribio esse cara e foda!

https://sampforum.blast.hk/showthread.php?tid=113443


poucos aqui conhecem as coisas boas que tem pelo forum tem muitas includes foda por ae basta pesquisar!
Reply
#9

Quote:
Originally Posted by Q.I
Посмотреть сообщение
boa sobre quem quiser a include progress mais o create progress visite o link do toribio esse cara e foda!

https://sampforum.blast.hk/showthread.php?tid=113443


poucos aqui conhecem as coisas boas que tem pelo forum tem muitas includes foda por ae basta pesquisar!
Vejo que ninguйm leu o tуpico antes de postar ;/


Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Crйditos
Bom, o sistema foi totalmente elaborado por min, mais tive que utilizar uma include,
para fazer a barra de progresso, ela se chama Progress Bar, criada pelo nosso amigo
Torobio (link).
Reply
#10

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Vejo que ninguйm leu o tуpico antes de postar ;/
sim eu nao tinha lido o topico todo so vi o sistema !

mals mais o seu projeto e massa! <
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)