SA-MP Forums Archive
[Pedido]Sistema de Blindagem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido]Sistema de Blindagem (/showthread.php?tid=325113)



[Pedido]Sistema de Blindagem - Luiiz - 12.03.2012

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?


Re: Sistema de Blindagem - BlackCoder - 12.03.2012

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


Re: Sistema de Blindagem - Luiiz - 12.03.2012

pode esplicar melhor? to iniciando ainda rs


Re: Sistema de Blindagem - luizfel2 - 12.03.2012

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;
  }



Re: Sistema de Blindagem - paulor - 12.03.2012

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;
}



Re: Sistema de Blindagem - Luiiz - 12.03.2012

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


Re: Sistema de Blindagem - Lucas_Alemao - 12.03.2012

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


Re: Sistema de Blindagem - zbt - 12.03.2012

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 ;
}



Re: Sistema de Blindagem - Luiiz - 12.03.2012

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


Re: Sistema de Blindagem - luizfel2 - 12.03.2012

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