SA-MP Forums Archive
Armored Cars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Armored Cars (/showthread.php?tid=491793)



Armored Cars - Deniz1467 - 01.02.2014

Hey guys, I'm using NGRP/Horizon RP Gamemode, I want to make PD vehicles (596, 597, 598 ) armored, but I cant. I dont know how to use 'SetVehicleHealth'.


Re: Armored Cars - Deniz1467 - 01.02.2014

No one?


Re: Armored Cars - J4mmyHD - 01.02.2014

Try this

pawn Код:
// On gamemode init
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) == 596 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 598)
    {
        SetVehicleHealth(i, 9999999);
        print("Armored Cars Loaded.");
    }
}



Re: Armored Cars - Deniz1467 - 02.02.2014

Quote:
Originally Posted by J4mmyHD
Посмотреть сообщение
Try this

pawn Код:
// On gamemode init
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) == 596 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 598)
    {
        SetVehicleHealth(i, 9999999);
        print("Armored Cars Loaded.");
    }
}
Not working sir.


Re: Armored Cars - Don_Cage - 02.02.2014

Quote:
Originally Posted by Deniz1467
Посмотреть сообщение
Not working sir.
Are you sure you put it under the OnGameModeInit callback? Because this worked good for me.


Re: Armored Cars - Deniz1467 - 02.02.2014

Quote:
Originally Posted by Don_Cage
Посмотреть сообщение
Are you sure you put it under the OnGameModeInit callback? Because this worked good for me.
I put it like that, I think I cant put it truely.

pawn Код:
public OnGameModeInit()
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) == 596 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 598)
    {
        SetVehicleHealth(i, 3000);
        print("Armored Cars Loaded.");
    }
}
    new



Respuesta: Armored Cars - Samuel6 - 02.02.2014

Hey Guys i Was looking something how this But, I Will test it For My Server Role Play


Re: Armored Cars - Treyvan - 02.02.2014

Quote:
Originally Posted by Deniz1467
Посмотреть сообщение
I put it like that, I think I cant put it truely.

pawn Код:
public OnGameModeInit()
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) == 596 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 598)
    {
        SetVehicleHealth(i, 3000);
        print("Armored Cars Loaded.");
    }
}
    new
You also need to make sure that the vehicles for your server are being loaded first, before performing that function. If the vehicles aren't loaded, it can't set the health, because the cars aren't there. So put it after the vehicle load function.


Respuesta: Re: Armored Cars - Samuel6 - 03.02.2014

Quote:
Originally Posted by J4mmyHD
Посмотреть сообщение
Try this

pawn Код:
// On gamemode init
for(new i = 0; i < MAX_VEHICLES; i++)
{
    if(GetVehicleModel(i) == 596 || GetVehicleModel(i) == 597 || GetVehicleModel(i) == 598)
    {
        SetVehicleHealth(i, 9999999);
        print("Armored Cars Loaded.");
    }
}
Guy It no work


Re: Respuesta: Re: Armored Cars - Don_Cage - 03.02.2014

Quote:
Originally Posted by Samuel6
Посмотреть сообщение
Guy It no work
I works, I tested it on my server.
For those who say it doesnt work: If you dont know where to put the code, just ask insted of saying that it doesnt work!