Armored Cars
#1

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'.
Reply
#2

No one?
Reply
#3

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.");
    }
}
Reply
#4

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.
Reply
#5

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

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
Reply
#7

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

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.
Reply
#9

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
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)