SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/02/2014, 07:43 AM   #1
Deniz1467
Little Clucker
 
Deniz1467's Avatar
 
Join Date: Aug 2012
Location: Republic of Turkey
Posts: 38
Reputation: 3
Default Armored Cars

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'.
Deniz1467 is offline   Reply With Quote
Old 01/02/2014, 08:54 AM   #2
Deniz1467
Little Clucker
 
Deniz1467's Avatar
 
Join Date: Aug 2012
Location: Republic of Turkey
Posts: 38
Reputation: 3
Default Re: Armored Cars

No one?
Deniz1467 is offline   Reply With Quote
Old 01/02/2014, 09:03 AM   #3
J4mmyHD
Huge Clucker
 
J4mmyHD's Avatar
 
Join Date: Oct 2012
Location: United Kingdom
Posts: 274
Reputation: 42
Default Re: Armored Cars

Try this

pawn Code:
// 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.");
    }
}
__________________
J4mmyHD is offline   Reply With Quote
Old 02/02/2014, 07:05 AM   #4
Deniz1467
Little Clucker
 
Deniz1467's Avatar
 
Join Date: Aug 2012
Location: Republic of Turkey
Posts: 38
Reputation: 3
Default Re: Armored Cars

Quote:
Originally Posted by J4mmyHD View Post
Try this

pawn Code:
// 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.
Deniz1467 is offline   Reply With Quote
Old 02/02/2014, 07:10 AM   #5
Don_Cage
High-roller
 
Don_Cage's Avatar
 
Join Date: Aug 2012
Posts: 1,073
Reputation: 40
Default Re: Armored Cars

Quote:
Originally Posted by Deniz1467 View Post
Not working sir.
Are you sure you put it under the OnGameModeInit callback? Because this worked good for me.
Don_Cage is offline   Reply With Quote
Old 02/02/2014, 07:25 AM   #6
Deniz1467
Little Clucker
 
Deniz1467's Avatar
 
Join Date: Aug 2012
Location: Republic of Turkey
Posts: 38
Reputation: 3
Default Re: Armored Cars

Quote:
Originally Posted by Don_Cage View Post
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 Code:
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
Deniz1467 is offline   Reply With Quote
Old 02/02/2014, 03:49 PM   #7
Samuel6
Little Clucker
 
Join Date: Jan 2014
Posts: 34
Reputation: 1
Default Respuesta: Armored Cars

Hey Guys i Was looking something how this But, I Will test it For My Server Role Play
__________________
Samuel6 Scripter "Noob"
Latino Gaming RolePlay 65%
IP : maintenance for vs 0.6 / mantenimiento para vs 0.6 (PRUEBA)
Se busca Web Master que haga un Tema Unico


Samuel6 is offline   Reply With Quote
Old 02/02/2014, 04:29 PM   #8
Treyvan
Big Clucker
 
Join Date: Jul 2008
Posts: 63
Reputation: 30
Default Re: Armored Cars

Quote:
Originally Posted by Deniz1467 View Post
I put it like that, I think I cant put it truely.

pawn Code:
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.
__________________


Treyvan is offline   Reply With Quote
Old 02/02/2014, 04:41 PM   #9
Samuel6
Little Clucker
 
Join Date: Jan 2014
Posts: 34
Reputation: 1
Default Respuesta: Armored Cars

I was that way but had a bug, Car Fam / facc Of all the ID had 2500 life

Look it

pawn Code:
/*============== Autos, Motos, Rhino con modificaciones de vida ==============*/
#include <a_samp>
//----------------------
#if defined FILTERSCRIPT
//----------------------------------------------------
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Autos");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}
//----------------------------------------------------
#else

main()
{
print("\n----------------------------------");
print(" Autos ");
print("----------------------------------\n");
}

#endif
//---------------------------------------------------------
public OnVehicleSpawn(vehicleid)
{
new modelo = GetVehicleModel(vehicleid);
if(modelo == 407 || modelo == 416 || modelo == 427 || modelo == 433 || modelo == 470,476,497,500,421,520 || modelo == 490 || modelo == 528 || modelo == 544 || modelo == 596 || modelo == 597 || modelo == 598 || modelo == 601 || modelo == 425 || modelo == 428 || modelo == 432 || modelo == 433)
//El id del auto 411 es el modelo Infernus, 522 es NRG-500 moto y 432 rhino
{
SetVehicleHealth(vehicleid, 2500.0);// La cantidad de vida del auto 1000 y 500 sale humo
}

return 1;
}
/*============================ Fin ===========================================*/
__________________
Samuel6 Scripter "Noob"
Latino Gaming RolePlay 65%
IP : maintenance for vs 0.6 / mantenimiento para vs 0.6 (PRUEBA)
Se busca Web Master que haga un Tema Unico


Samuel6 is offline   Reply With Quote
Old 03/02/2014, 12:13 AM   #10
Samuel6
Little Clucker
 
Join Date: Jan 2014
Posts: 34
Reputation: 1
Default Respuesta: Re: Armored Cars

Quote:
Originally Posted by J4mmyHD View Post
Try this

pawn Code:
// 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
__________________
Samuel6 Scripter "Noob"
Latino Gaming RolePlay 65%
IP : maintenance for vs 0.6 / mantenimiento para vs 0.6 (PRUEBA)
Se busca Web Master que haga un Tema Unico


Samuel6 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Armored Stretch_O v1.0 By Otacon OTACON Filterscripts 3 21/06/2012 11:54 AM
[FilterScript] Armored Truck willsuckformoney Filterscripts 14 10/01/2012 01:19 PM
I need help with a script i can carry cars with airplanes and cars [USAK]Icey Help Archive 8 23/08/2011 11:18 PM
Give all cars in OnGameModeInit Components (Tune all cars) RyDeR` Help Archive 4 05/10/2009 04:37 PM
LARP: Cars.cfg adding cars problem... Typhome Help Archive 7 06/07/2009 12:46 PM


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.