[Pedido]Sistema de Blindagem
#1

Galera nгo sei nem por onde comeзar rs, queria um sistema de blindagem tipo teria um lugar no mapa onde o cara chegase la de carro e dese /blindar ae adicionaria 100% de blindagem no carro, ae quando o carro batese rancava 5 de blindagem ate a blindagem acabar e comeзar a rancar o life do carro

alguem pode me ajudar?
Reply
#2

vou lhe dar umas dicas:

crie o comando /blindar usando a fuзгo
IsPlayerInRangeOfPoint

e depois setvehiclehealth com 2000 de vida que й o dobro do padrao
Reply
#3

pode esplicar melhor? to iniciando ainda rs
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/blindar", true) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, Cordenada X, Cordenada Y, Cordenada Z)) {
        new vehicleid = GetPlayerVehicleID(playerid);
        SetVehicleHealth(vehicleid, 2000.0);
        SendClientMessage(playerid, -1, "Vocк adicionou blindagem.");
    }
    return 1;
  }
Reply
#5

Mais simples impossivel! Pegue como base...
pawn Код:
SetTimer("Blindado", 500, true);//OnGameModeInit

//Fim GM
stock Blindado()
{
    for(new vehicleid = 0; vehicleid < MAX_VEHICLES; ++vehicleid)
    {
        if(CarroBlindado[vehicleid] == 1)
        {
            SetVehicleHealth(vehicleid, 1000);
        }
    }
    return 1;
}

CMD:blindar(playerid)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "ErrOr - Entre em um veiculo!");
    if(CarroBlindado[vehicleid] == 1) return SendClientMessage(playerid, -1, "ErrOr - O Veiculo jб й blindado!");
   
    if(IsPlayerInRangeOfPoint(playerid, 3, X, Y, Z)//Coords do local
    {
        CarroBlindado[vehicleid] = 1;
        SendClientMessage(playerid, -1, "InFo - Veiculo Blindado com sucesso!");
    }
    else SendClientMessage(playerid, -1, "ErrOr - Vocк nгo esta no local determinado!");
    return 1;
}
Reply
#6

massa paulo agora como bota no velocimetro tipo tem gasolina lataria e etc ae eu queria por blindagem
Reply
#7

Serб q um loop de MAX VEHICLES chamado a cada meio segundo с vai dar lag?
Reply
#8

tenta ae

pawn Код:
new Blindagem [ MAX_VEHICLES ] ;
new bool:tem [ MAX_VEHICLES ] ;

CMD:blindagem ( playerid ) {
    if ( !IsPlayerInRangeOfPoint ( playerid , Raio , x , y , z ) )
        return false ;
    new vehicleid = GetPlayerVehicleID ( playerid ) ;
    Blindagem [ vehicleid ] = 1000 ;
    tem [ vehicleid ] = true ;
    SendClientMessage ( playerid , -1 , "Blindagem adcionada" ) ;
    return true ;
}

public OnVehicleDamageStatusUpdate ( vehicleid , playerid ) {
    if ( tem [ vehicleid ] == true ) {
        SetVehicleHealth ( vehicleid , 1000 ) ;
        Blindagem [ vehicleid ] -= 5 ;
        if ( Blindagem [ vehicleid ] == 0 ) {
            tem [ vehicleid ] = false ;
        }
    }
    return true ;
}
Reply
#9

nem deu ,o cmd do luixfel ficou certinho so falta adicionar no velocimtro
Reply
#10

Quote:
Originally Posted by Luiiz
Посмотреть сообщение
nem deu ,o cmd do luixfel ficou certinho so falta adicionar no velocimtro
da rep + se nгo for incomodo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)