XADRENALINEIX

My Vehicle Model Name & Hash Displayer

Jul 24th, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.76 KB | None | 0 0
  1. #include <natives.h>
  2. #include <common.h>
  3. #include <consts.h>
  4.  
  5. #define true 1
  6. #define false 0
  7.  
  8. int veh = 0;
  9. unsigned int Model = 0;
  10. char *vehname;
  11.  
  12. // YOU WILL HAVE TO ADD IN YOUR OWN ARGUMENTS TO SETUP THE DRAWS!!!!!!!!!!!!!!!
  13.  
  14. void setupdraw(int r,int g,int b){
  15.     SET_TEXT_FONT(); //Set font
  16.     SET_TEXT_SCALE(,); //Set text size
  17.     SET_TEXT_COLOUR(r,g,b,255);// Set text r,g,b when function is called & alpha is 255
  18.     SET_TEXT_DROPSHADOW(false,0,0,0,255);// Set text shadow
  19. }
  20.  
  21. void Displayer(void){
  22.     if(IS_CHAR_IN_ANY_CAR(GetPlayerPed())){//If you're in a car
  23.         GET_CAR_CHAR_IS_USING(GetPlayerPed(),&veh);// Get car you're using and store handle in veh
  24.         GET_CAR_MODEL(veh,&Model); //Get the model hash from veh and store it in Model
  25.         vehname = GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(Model); //Get vehicle name from hash stored in Model
  26.     }
  27.     else{ //Else you have no car
  28.         vehname = "You have no vehicle"; //Draw You have no vehicle
  29.         Model = 0; //Model hash = 0
  30.     }
  31.    
  32.     setupdraw(,,); //Set the R,G,B for the text
  33.     SET_TEXT_EDGE(true,,,,); //Give the text a neon outline
  34.     DISPLAY_TEXT_WITH_LITERAL_STRING(,,"string",vehname); //Vehicle Model Name
  35.  
  36.     setupdraw(,,); //Set the R,G,B for the text
  37.     SET_TEXT_EDGE(true,,,,); //Give the text a neon outline
  38.     DISPLAY_TEXT_WITH_NUMBER(+(GET_STRING_WIDTH_WITH_STRING("STRING",vehname)+0.012),,"NUMBER",Model);
  39.     //Display model name then display the hash after the model name, +0.012 = spacing between Model name and hash
  40. }
  41.  
  42. void main(void){
  43.     THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
  44.     print("Created by ADRENALINE IX",4000);
  45.     while(true){
  46.         WAIT(0);
  47.         Displayer();
  48.     }
  49. }
  50.  
  51. // YOU WILL HAVE TO ADD IN YOUR OWN ARGUMENTS TO SETUP THE DRAWS!!!!!!!!!!!!!!!
Advertisement
Add Comment
Please, Sign In to add comment