Advertisement
Guest User

[FS] JohnnyYz Personal Car Sistem

a guest
Sep 6th, 2014
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.91 KB | None | 0 0
  1. /*
  2. ********************************************************************************
  3.                                JohnnyYz Personal Car
  4.                                Credits: JohnnyYz
  5.                                Helper : Sa-mp.com ; Sa-mp.ro
  6.                                Contact: Y/m : xt3z0ne / Skype : xt3z0ne123
  7.                                      ~Info~
  8.           Daca modifici creditele atunci sa iti fut morti ma-tii!!!
  9.  
  10. ********************************************************************************
  11. */
  12. #include "a_samp"
  13. #include " zcmd "
  14. //==============================================================================
  15. // Color Info
  16. //==============================================================================
  17. #define COLOR_ORANGE                                            0xFF9900AA
  18. #define COLOR_RED                                               0xFF0000AA
  19. #define COLOR_GREEN                                             0x66ff00
  20. #define COLOR_BLUE                                              0x00b3ff
  21. //==============================================================================
  22. // Car Info Proprietar
  23. //==============================================================================
  24. #define Car_Personal                                           "JohnnyYz"
  25. //==============================================================================
  26. // Car Info New Variables
  27. //==============================================================================
  28. new
  29.     jcar, Float:x,
  30.     Float:y, Float:z;
  31. //==============================================================================
  32. // Car Info Script Loading
  33. //==============================================================================
  34. public OnFilterScriptInit()
  35. {
  36.     print("\n");
  37.     print("========================================");
  38.     print("+--       JohnnyYz Personal Car      --+");
  39.     print("========================================");
  40.     print("\n");
  41.     //================
  42.     LoadingJcar();
  43.     //================
  44.     return 1;
  45. }
  46. //==============================================================================
  47. // Car Info Commands
  48. //==============================================================================
  49. CMD:mycar(playerid, params[])
  50. {
  51.     if(strcmp(pName(playerid), Car_Personal, true) == 0)
  52.     {
  53.         if(!IsPlayerInAnyVehicle(playerid))
  54.         {
  55.             GetPlayerPos(playerid, x,y,z)SetVehiclePos(jcar, x+2,y+2,z);
  56.             PutPlayerInVehicle(playerid, jcar, 0); LoadingSuccess( playerid ) ;
  57.         }
  58.         else allready(playerid);
  59.     }
  60.     return 1;
  61. }
  62. //==============================================================================
  63. // Car Info StateChange
  64. //==============================================================================
  65. public OnPlayerStateChange(playerid, newstate, oldstate)
  66. {
  67.     //================
  68.     new vehicleid = GetPlayerVehicleID(playerid);
  69.     //================
  70.     if(newstate == PLAYER_STATE_DRIVER)
  71.     {
  72.         if(vehicleid == jcar && GetVehicleModel(vehicleid) == 411)
  73.         {
  74.             if(strcmp(pName(playerid), Car_Personal, true) == 0 || IsPlayerAdmin(playerid))
  75.             {
  76.                 return 1;
  77.             }
  78.             else
  79.             {
  80.                 GetPlayerPos(playerid, x,y,z); SetPlayerPos(playerid, x,y,z+5);
  81.                 return MycarInfo(playerid, 1);
  82.             }
  83.          }
  84.     }
  85.     return 1;
  86. }
  87. //==============================================================================
  88. public OnPlayerExitVehicle( playerid, vehicleid )
  89. {
  90.     //Script Loading
  91.     return 1;
  92. }
  93. //==============================================================================
  94. // Car Info Stocks Funcions
  95. //==============================================================================
  96. stock pName(playerid)
  97. {
  98.     new Name[MAX_PLAYER_NAME];
  99.     GetPlayerName(playerid, Name, 24);
  100.     return Name;
  101. }
  102. //==============================================================================
  103. stock MycarInfo(playerid, EID)
  104. {
  105.     //================
  106.     new string[500];
  107.     //================
  108.     if(EID == 1)
  109.     {
  110.      format(string,sizeof(string),"{59ff00}Acceasta masina este a lui {ff1500}%s\n{59ff00}Daca doresti si tu o masina personala contacteaza un {ff1500}Fondator ",  Car_Personal);
  111.     }
  112.     //================
  113.     return ShowPlayerDialog(playerid, 6000, DIALOG_STYLE_MSGBOX, "{ffffff}Personal {ff0000}Car {48ff00}Info",  string, "Ok", "Close");
  114.     //================
  115. }
  116. //==============================================================================
  117. stock LoadingSuccess(playerid)
  118. {
  119.     //================
  120.     new string[500];
  121.     //================
  122.     format(string,sizeof(string),"{59ff00}Felicitari {ff1500}%s {59ff00}tocmai ti-ai spawnat masina personala cu {ff1500}Succes", pName(playerid));
  123.     //================
  124.     return ShowPlayerDialog(playerid, 6000, DIALOG_STYLE_MSGBOX, "{ffffff}Personal {ff0000}Car {48ff00}Info",  string, "Ok", "Close");
  125.     //================
  126. }
  127. //==============================================================================
  128. stock allready(playerid)
  129. {
  130.     return SendClientMessage(playerid, COLOR_RED, "ERROR: You allready have a vehicle!");
  131. }
  132. //==============================================================================
  133. stock LoadingJcar()
  134. {
  135.     //--------------------------------------------------------------------------
  136.     jcar = AddStaticVehicle(411, 308.6042, 1991.7235, 18.5776, 89.7925, 35,12);
  137.     //--------------------------------------------------------------------------
  138. }
  139. /*
  140. ********************************************************************************
  141.                                JohnnyYz Personal Car
  142.                                Credits: JohnnyYz
  143.                                Helper : Sa-mp.com ; Sa-mp.ro
  144.                                Contact: Y/m : xt3z0ne / Skype : xt3z0ne123
  145.                                      ~Info~
  146.           Daca modifici creditele atunci sa iti fut morti ma-tii!!!
  147.  
  148. ********************************************************************************
  149.  
  150. stock LoadingSuccess(playerid)
  151. {
  152.     new string[500],str[120];
  153.     format(string,sizeof(string), "{59ff00}Felicitari {ff1500}%s {59ff00}tocmai ti-ai spawnat masina personala cu {ff1500}Succes", pName);
  154.     return ShowPlayerDialog(playerid, 6000, "{ffffff}Personal {ff0000}Car {48ff00}Info",  string,"Close", " ");
  155. }
  156.  
  157. */
  158. CMD:test(playerid,params[])
  159.     return SetPlayerPos( playerid, 308.6042, 1991.7235, 18.5776 ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement