Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <natives.h>
- #include <common.h>
- #include <consts.h>
- #include <types.h>
- #include <strings.h>
- /*********************************
- * Always have this to the number
- * of objects or vehicles
- * you want + 1 to keep the
- * array from breaking your
- * script.
- *********************************/
- #define NUM_OF_OBJECTS 3
- #define NUM_OF_VEH 3
- Object objects[NUM_OF_OBJECTS];
- Vehicle vehicles[NUM_OF_VEH];
- bool network;
- uint episode;
- void create_object(uint model, float x, float y, float z, float h, float qx, float qy, float qz, float qw, bool dynamic, int id){
- int nvid;
- if(IS_MODEL_IN_CDIMAGE(model)){
- REQUEST_MODEL(model);
- while(!HAS_MODEL_LOADED(model)) WAIT(0);
- CREATE_OBJECT_NO_OFFSET(model, x, y, z, &objects[id], true);
- SET_OBJECT_HEADING(objects[id], h);
- SET_OBJECT_QUATERNION(objects[id], qx, qy, qz, qw);
- SET_OBJECT_INVINCIBLE(objects[id], true);
- SET_OBJECT_PROOFS(objects[id], false, false, false, false, false);
- SET_OBJECT_VISIBLE(objects[id], true);
- SET_OBJECT_LIGHTS(objects[id], true);
- if (dynamic)
- SET_OBJECT_DYNAMIC(objects[id], true);
- else
- FREEZE_OBJECT_POSITION(objects[id], true);
- MARK_MODEL_AS_NO_LONGER_NEEDED(model);
- WAIT(50);
- if(network){
- GET_NETWORK_ID_FROM_OBJECT(objects[id], &nvid);
- SET_NETWORK_ID_CAN_MIGRATE(nvid, false);
- }
- }
- else print("One or more object models not in episode!");
- }
- void create_car(uint model,float x,float y,float z,float h, float qx, float qy, float qz, float qw, int id){
- if(IS_MODEL_IN_CDIMAGE(model)){
- REQUEST_MODEL(model);
- while(!HAS_MODEL_LOADED(model)) WAIT(0);
- CREATE_CAR(model,x,y,z,&vehicles[id],true);
- SET_CAR_HEADING(vehicles[id],h);
- SET_VEHICLE_QUATERNION(vehicles[id], qx, qy, qz, qw);
- MARK_MODEL_AS_NO_LONGER_NEEDED(model);
- }
- else print("One or more vehicle models not in episode!");
- }
- void main(void){
- THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
- episode = GET_CURRENT_EPISODE();
- network = IS_NETWORK_SESSION();
- WAIT(500);
- create_object(
- create_object(
- /*********************************
- * Credits if you want to have
- * some in the script.
- *********************************/
- print("Map Name name");
- WAIT(5000);
- print("By: Creator");
- while(true)
- WAIT(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment