I need a help to build a Gta 5 script
Basically, I need a script that turns on the engine of a certain car at stroke of 12 pm and attack (try to drive over) the player if he is within its radius.
It seems complex, hence I need some help. I am new to gta 5 scripting and have a basic knowledge about C#!
I see this having to go one of two ways.
You wanna turn on the engine of a certain car at the break of night.
Firstly, can't just turn on an engine of a vehicle. gotta get that vehicles handle, (the vehicle will be either already spawned, or your mod spawned it when activated). Which then you should spawn a N.P.C inside the vehicle, with the vehicles handle Id you got from (already spawned vehicle found or the vehicle your mod spawned when your it detected it's cue to activate)
In these parenthesis above, I basically mean you could check if a player (yourself) is in a certain location, and trigger something. That being said, one could add many locations to check for while the mod is active, and spawn the vehicle when ever it detects you in one of the many certain locations you may have wanted.
http://dev-c.com/nativedb/ (Pssp! May wanna download this. http://dev-c.com/nativedb/reference.html )
-IS_ANY_PED_NEAR_POINT(float x, float y, float z, float radius)
-IS_ANY_VEHICLE_NEAR_POINT(float x, float y, float z, float radius)
Couple ways / things you could attempt.
-You could get a random N.P.C that is in a vehicle at set coordinates.
Or if your taking the other route of(getting a player in location, if player detected in location, you can get closest ped, and do stuff with that ped.)
It's worth checking these out.
- PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ThatOnePed, true);
- PED::SET_PED_FLEE_ATTRIBUTES(ThatOnePed, 0, 0);
- PED::SET_PED_COMBAT_ATTRIBUTES(ThatOnePed, 17, 1);
- AI::TASK_VEHICLE_CHASE(ThatOnePed, MyVehicle)
- AI::TASK_VEHICLE_GOTO_NAVMESH(ThatOnePed, MyVehicle, Myself.x, Myself.y, Myself.z, GAMEPLAY::GET_RANDOM_FLOAT_IN_RANGE(66.0f, 100.3f), 171, RideMyRange);
With a 171 set bit, it will make ~ThatOnePed~ avoid almost any object and vehicle with the addition of not running over N/P/C's (Pedestrians).
If you still need assistance with this, it doesn't seem to hard at all. I just whipped up this little help post above, so their could be more I have yet to look at.
- C++ That is.
- ScriptHookV That is.
- Simple C++ Menu Base That is.
- Scripting That is.
Blocking a Pedestrians NON_TEMPORARY_EVENTS indefinitely will make the pedestrian act as if it's in a Utopian society (Where nothing bad can or ever will happen) Just about!