Advertisement
Guest User

lvdm

a guest
Dec 7th, 2010
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.37 KB | None | 0 0
  1. //==============================================================================
  2. //                            Starting Of the GameMode                        //
  3. //==============================================================================
  4.  
  5. /*This GameMode is developed by Jordi Hoock Castro, (universe at Forums), i must
  6. accept, that this GameMode is a simple basic shit, but why i release it?, ok i
  7. started scripting like 4 days ago, and i want your critics, opinions, etc.. i
  8. did this For me, cause im scripting intensively during 4 days, all the day and
  9. all the night, i hope you enjoy it, and if not only say, how you like it, also
  10. structuring, etc..*/
  11.  
  12. //==============================================================================
  13. // Includes
  14. //==============================================================================
  15.  
  16. #include <a_samp>
  17.  
  18. //==============================================================================
  19. // Defines
  20. //==============================================================================
  21.  
  22. //--------------------------------
  23. // Colours
  24. //--------------------------------
  25.  
  26.  
  27. #define COLOR_GREY 0xAFAFAFAA
  28. #define COLOR_GREEN 0x33AA33AA
  29. #define COLOR_YELLOW 0xFFFF00AA
  30. #define COLOR_LIGHTBLUE 0x00D0F6AA
  31. #define COLOR_PURPLE 0xA600F6AA
  32. #define COLOR_TUT 0xF6C861AA
  33. #define COLOR_ROYAL 0x00C1F6AA
  34. #define COLOR_CWHITE 0xE0FFFFAA
  35.  
  36.  
  37. //--------------------------------
  38. // Vehicles etc..
  39. //--------------------------------
  40.  
  41.  
  42. #define RESPAWN_TIME 1 // 1 minutes
  43.  
  44. //--------------------------------
  45. // Third Party Applications
  46. //--------------------------------
  47.  
  48.  
  49. #define strtok
  50.  
  51.  
  52. //--------------------------------
  53. // Dialogs
  54. //--------------------------------
  55.  
  56.  
  57. #define D_Connect             1
  58. #define D_Help                2
  59. #define D_Rules               3
  60.  
  61.  
  62. //==============================================================================
  63. // Forwards
  64. //==============================================================================
  65.  
  66. forward VehicleRespawn();
  67.  
  68. //==============================================================================
  69. // Main
  70. //==============================================================================
  71.  
  72.  
  73. main()
  74. {
  75.     print("\n----------------------------------");
  76.     print(" Simple DM GameMode in Las Venturas");
  77.     print("----------------------------------\n");
  78.  
  79. }
  80.  
  81.  
  82. //==============================================================================
  83. // General
  84. //==============================================================================
  85.  
  86.  
  87. //-----------------------
  88. // Spawn Info
  89. //-----------------------
  90.  
  91.  
  92. public OnGameModeInit()
  93. {
  94.     SetGameModeText("Las Venturas DM");
  95.     AddPlayerClass(7, 2585.61, 2787.45, 15.23, 0, 46, 5, 26, 500, 18, 10);
  96.     SetTimer("VehicleRespawn", RESPAWN_TIME * 60000, 1);
  97.  
  98. //--------------------------------
  99. // Objects & Vehicles
  100. //--------------------------------
  101. AddStaticVehicleEx(563,2613.55175781,2724.36010742,37.42439270,0.00000000,-1,-1,15); //Raindance
  102. AddStaticVehicleEx(469,2625.35839844,2722.03222656,36.63864136,0.00000000,-1,-1,15); //Sparrow
  103. AddStaticVehicleEx(541,2549.69189453,2769.08520508,10.52031231,0.00000000,-1,-1,15); //Bullet
  104. AddStaticVehicleEx(415,2569.74877930,2768.83618164,10.66983414,0.00000000,-1,-1,15); //Cheetah
  105. AddStaticVehicleEx(562,2520.49267578,2768.54614258,10.57386208,0.00000000,-1,-1,15); //Elegy
  106. AddStaticVehicleEx(587,2520.52612305,2737.79443359,10.62297916,0.00000000,-1,-1,15); //Euros
  107. AddStaticVehicleEx(603,2545.29663086,2737.38232422,10.81565380,0.00000000,-1,-1,15); //Phoenix
  108. AddStaticVehicleEx(451,2569.80883789,2738.24755859,10.57735062,0.00000000,-1,-1,15); //Turismo
  109. CreateObject(10079,2537.09741211,2806.80053711,13.08204651,0.00000000,0.00000000,4.00000000); //object(pyr_top_sfe) (1)
  110. CreateObject(1263,2539.25854492,2817.72973633,12.97315216,0.00000000,0.00000000,0.00000000); //object(mtraffic3) (1)
  111. CreateObject(2690,2504.01586914,2780.96850586,12.28566360,0.00000000,0.00000000,0.00000000); //object(cj_fire_ext) (1)
  112. CreateObject(16613,2565.39062500,2823.93334961,26.82031250,0.00000000,0.00000000,206.00000000); //object(des_bigtelescope) (1)
  113. CreateObject(16093,2586.77172852,2788.29125977,14.10115719,0.00000000,0.00000000,0.00000000); //object(a51_gatecontrol) (1)
  114. }
  115.  
  116.  
  117. //-----------------------
  118. // Some Info Messages
  119. //-----------------------
  120. public OnPlayerConnect(playerid)
  121. {
  122.     ShowPlayerDialogOnConnect(playerid);
  123.     return 1;
  124. }
  125.  
  126.  
  127. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  128. {
  129.     new message[128];
  130.     format(message, 128, "You clicked on player %d", clickedplayerid);
  131.     SendClientMessage(playerid, COLOR_YELLOW, message);
  132.     return 1;
  133. }
  134.  
  135. public OnPlayerDeath(playerid, killerid, reason)
  136. {
  137.     SendClientMessageToAll(COLOR_PURPLE, "A Player has die, RUN!");
  138.     return 1;
  139. }
  140.  
  141. //-----------------------
  142. // Whole Vehicle respawn system
  143. //-----------------------
  144.  
  145. public VehicleRespawn() {
  146.     SendClientMessageToAll(COLOR_LIGHTBLUE, "All Unused vehicles respawned");
  147.     for(new i = 0; i < MAX_VEHICLES; i ++ ) {
  148.          for(new o = 0; o < GetMaxPlayers(); o ++ ) {
  149.               if(!IsPlayerConnected(o)) continue;
  150.               if(IsAnyBodyInVehicle(i)) continue;
  151.               SetVehicleToRespawn(i);
  152.              
  153.          }
  154.     }
  155.     return 1;
  156. }
  157.  
  158. stock IsAnyBodyInVehicle(vid) {
  159.   for(new i = 0; i < GetMaxPlayers(); i ++ ) {
  160.        if(IsPlayerInVehicle(i, vid)) return 1;
  161.   }
  162.   return 0;
  163. }
  164.  
  165. //==============================================================================
  166. // Dialogs
  167. //==============================================================================
  168.  
  169.  
  170.  
  171. //-----------------------
  172. // General dialog Info
  173. //-----------------------
  174.  
  175.  
  176. ShowPlayerDialogOnConnect(playerid)
  177. {
  178.     ShowPlayerDialog(playerid, D_Connect, DIALOG_STYLE_MSGBOX, "Hello There", "Hello Mate, This is an free opensource, basic DM server. You can download this script freely at www.sa-mp.com\nThis gamemode was created for personal purposing, not for professional.\n\nAlso enjoy the server, and respect de rules, more information at /help,\nTO START PLAYING CLICK ON SPAWN", "Accept", "Cancel");
  179.     return 1;
  180. }
  181.  
  182.  
  183.  
  184. ShowPlayerDialogHelpCommand(playerid)
  185. {
  186.     ShowPlayerDialog(playerid, D_Help,DIALOG_STYLE_MSGBOX,"¿Some Help?","Here you have some commands for IG\n/rules - show the rules","Accept", "Cancel");
  187.     return 1;
  188. }
  189.  
  190. ShowPlayerDialogRulesCommand(playerid)
  191. {
  192.     ShowPlayerDialog(playerid, D_Rules,DIALOG_STYLE_MSGBOX,"Rules","- Dont Flood/spamm the chat\n- Dont use any third application to modify the game content","Accept", "Cancel");
  193.     return 1;
  194. }
  195.  
  196.  
  197.  
  198.  
  199. //==============================================================================
  200. // Commands
  201. //==============================================================================
  202.  
  203.  
  204. public OnPlayerCommandText(playerid, cmdtext[])
  205. {
  206.  
  207.     if(!strcmp(cmdtext, "/help", true))
  208.     {
  209.         ShowPlayerDialogHelpCommand(playerid);
  210.         return 1;
  211.     }
  212.    
  213.     if(!strcmp(cmdtext, "/rules", true))
  214.     {
  215.         SendClientMessageToAll(COLOR_GREEN, "A player is reading rules, Thats Nice!, go and follow them, /rules.");
  216.         ShowPlayerDialogRulesCommand(playerid);
  217.         return 1;
  218.     }
  219.  
  220. }
  221.  
  222. //==============================================================================
  223. //                              End of The Gamemode                           //
  224. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement