Tip:
Highlight text to annotate it
X
The cube is spawned with CreateObject(model, x, y, z, &lastobj). After spawning an object you need to make it solid with FreezeObjectPosition(lastobj, true) or it will fall through the ground.
sprintf_s(mes1,300,"Now viewing object: %i, %s, %i" ,listView, spawnedListObj[listView],maxObjects); PrintStringWithLiteralStringNow("STRING", mes1, 9500, 1); The %i represents an integer. This allows you to print numbers on the screen in the string holder mes1. The %s will hold string values such as "hippo".
The ped that just crashed sounded the horn with this native name, SoundCarHorn(vehicle, duration). duration tells the system how long the horn will last.
The hippo object was deleted with DeleteObject(&lastobj). The lastobj again is an object that points to the last object spawned.
The rocket launcher was created with GiveWeaponToChar(GetPlayerPed(),WEAPON_RLAUNCHER, 1000,0). The value 1000 is supposed to represent the total of weapons (in this case the rocket launcher) that will be carried by the player.
The time is initialized with u32 hour, minute; GetTimeOfDay(&hour, &minute). hour = hour + 6; (increased by 6 hours). Then it is set with SetTimeOfDay(hour,minute); ForceTimeOfDay(hour, minute); ReleaseTimeOfDay();
To erase the cops in the area use f32 x, y, z; Vehicle car = GetClosestCar(x, y, z, 100, CarRadius, 70); ClearAreaOfCops(x, y, z, 100); The GetClosestCar will scan the area within a 100 mile radius to clear the area of any police vehicles found. Pedestrians are erased with ClearAreaOfChars(x, y, z, 100);
Fire is spawned with AddExplosion(x, y, z, fireexplosionType, AddExpRadius, 50, 1, cameraShake). If you want the fire to be spread out add another AddExplosion (like this one). Then do something like AddExplosion(x + 10, Y-10, z, fireexplosionType, AddExpRadius, 50, 1, cameraShake);
When you provoke the cops, your wanted level is activated. Use ClearWantedLevel(GetPlayer()) to clear the wanted level and then the police will go about other business instead.
To set a pedestrian on fire use StartCharFire(ped);