Guest User

Untitled

a guest
Jun 28th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.20 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <streamer>
  7.  
  8. #define NORMAL_BLITZER 90
  9. #define MAX_U_BLITZER 10
  10. main()
  11. {
  12. print("\n----------------------------------");
  13. print(" Blank Gamemode by your name here");
  14. print("----------------------------------\n");
  15. }
  16.  
  17. new DB:BlitzerDB;
  18. enum blitzeri{
  19. ubObject,
  20. ubGebiet,
  21. ubID,
  22. Float:ubX,
  23. Float:ubY,
  24. Float:ubZ,
  25. Float:ubAng,
  26. ubMaxSpeed,
  27. ubWinkel,
  28. bool:ubErstellt,
  29. };
  30. new uBlitzer[MAX_U_BLITZER][blitzeri];
  31. public OnGameModeInit()
  32. {
  33. // Don't use these lines if it's a filterscript
  34. SetGameModeText("Blank Script");
  35. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  36. BlitzerDB = db_open("blitzer.db");
  37. db_query(BlitzerDB, "CREATE TABLE IF NOT EXISTS `Blitzer` (`bID`, `bX`, `bY`, `bZ`, `bRZ`, `bMaxSpeed`, `bWinkel`)");
  38. LoadBlitzer();
  39. return 1;
  40. }
  41. stock CreateBlitzer(Float:x, Float:y, Float:z, Float:rz, MaxSpeed, Winkel = NORMAL_BLITZER)
  42. {
  43. for(new i; i < MAX_U_BLITZER; i++)
  44. {
  45. if(uBlitzer[i][ubErstellt] == false)
  46. {
  47. #if !defined BLITZER_NO_SAVE
  48. new string[256];
  49. format(string, sizeof(string), "INSERT INTO `Blitzer` (`bID`, `bX`, `bY`, `bZ`, `bRZ`, `bMaxSpeed`, `bWinkel`) VALUES ('%i', '%f', '%f', '%f', '%f', '%i', '%i')", i, x, y, z, rz, MaxSpeed, Winkel);
  50. db_free_result(db_query(BlitzerDB, string));
  51. #endif
  52. uBlitzer[i][ubObject] = CreateDynamicObject(18880, x, y, z-1.2, 0.0, 0.0, (rz-180));
  53. uBlitzer[i][ubGebiet] = CreateDynamicRectangle(x-10, y-10, x+10, y+10);
  54. uBlitzer[i][ubID] = i;
  55. uBlitzer[i][ubX] = x;
  56. uBlitzer[i][ubY] = y;
  57. uBlitzer[i][ubZ] = z;
  58. uBlitzer[i][ubAng] = rz;
  59. uBlitzer[i][ubMaxSpeed] = MaxSpeed;
  60. uBlitzer[i][ubWinkel] = Winkel;
  61. uBlitzer[i][ubErstellt] = true;
  62. return i;
  63. }
  64. }
  65. return print(">>> [Uncles Blitzer] FEHLER: Beim erstellen vom Blitzer ist ein Fehler aufgetreten. (MAX_U_BLITZER zu klein?) <<<") & 0;
  66. }
  67. stock LoadBlitzer()
  68. {
  69. new rows, buffer[24], DBResult:result, slot;
  70. result = db_query(BlitzerDB, "SELECT * FROM `Blitzer`");
  71. rows = db_num_rows(result);
  72. if(rows == 0) return print("* 0 Blitzer geladen *");
  73. for(new i; i < rows; i++)
  74. {
  75. db_get_field(result, 0, buffer, 24), slot = strval(buffer), uBlitzer[slot][ubID] = slot;
  76. db_get_field(result, 1, buffer, 24), uBlitzer[slot][ubX] = floatstr(buffer);
  77. db_get_field(result, 2, buffer, 24), uBlitzer[slot][ubY] = floatstr(buffer);
  78. db_get_field(result, 3, buffer, 24), uBlitzer[slot][ubZ] = floatstr(buffer);
  79. db_get_field(result, 4, buffer, 24), uBlitzer[slot][ubAng] = floatstr(buffer);
  80. db_get_field(result, 5, buffer, 24), uBlitzer[slot][ubMaxSpeed] = strval(buffer);
  81. db_get_field(result, 6, buffer, 24), uBlitzer[slot][ubWinkel] = strval(buffer);
  82. uBlitzer[slot][ubObject] = CreateDynamicObject(18880, uBlitzer[slot][ubX], uBlitzer[slot][ubY], uBlitzer[slot][ubZ]-1.2, 0.0, 0.0, (uBlitzer[slot][ubAng]-180));
  83. uBlitzer[slot][ubGebiet] = CreateDynamicRectangle(uBlitzer[slot][ubX]-10, uBlitzer[slot][ubY]-10, uBlitzer[slot][ubX]+10, uBlitzer[slot][ubY]+10);
  84. uBlitzer[slot][ubErstellt] = true;
  85. db_next_row(result);
  86. }
  87. db_free_result(result);
  88. printf("* %i Blitzer geladen *", rows);
  89. return 1;
  90. }
  91. public OnGameModeExit()
  92. {
  93. db_close(BlitzerDB);
  94. return 1;
  95. }
  96.  
  97. public OnPlayerRequestClass(playerid, classid)
  98. {
  99. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  100. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  101. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  102. return 1;
  103. }
  104.  
  105. public OnPlayerConnect(playerid)
  106. {
  107. return 1;
  108. }
  109.  
  110. public OnPlayerDisconnect(playerid, reason)
  111. {
  112. return 1;
  113. }
  114.  
  115. public OnPlayerSpawn(playerid)
  116. {
  117. return 1;
  118. }
  119.  
  120. public OnPlayerDeath(playerid, killerid, reason)
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnVehicleSpawn(vehicleid)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnVehicleDeath(vehicleid, killerid)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnPlayerText(playerid, text[])
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnPlayerCommandText(playerid, cmdtext[])
  141. {
  142. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  143. {
  144. new Float:Pos[4];
  145. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  146. GetPlayerFacingAngle(playerid,Pos[3]);
  147. CreateBlitzer(Pos[0],Pos[1],Pos[2], Pos[3], 100);
  148. return 1;
  149. }
  150. return 0;
  151. }
  152.  
  153. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  154. {
  155. return 1;
  156. }
  157.  
  158. public OnPlayerExitVehicle(playerid, vehicleid)
  159. {
  160. return 1;
  161. }
  162.  
  163. public OnPlayerStateChange(playerid, newstate, oldstate)
  164. {
  165. return 1;
  166. }
  167.  
  168. public OnPlayerEnterCheckpoint(playerid)
  169. {
  170. return 1;
  171. }
  172.  
  173. public OnPlayerLeaveCheckpoint(playerid)
  174. {
  175. return 1;
  176. }
  177.  
  178. public OnPlayerEnterRaceCheckpoint(playerid)
  179. {
  180. return 1;
  181. }
  182.  
  183. public OnPlayerLeaveRaceCheckpoint(playerid)
  184. {
  185. return 1;
  186. }
  187.  
  188. public OnRconCommand(cmd[])
  189. {
  190. return 1;
  191. }
  192.  
  193. public OnPlayerRequestSpawn(playerid)
  194. {
  195. return 1;
  196. }
  197.  
  198. public OnObjectMoved(objectid)
  199. {
  200. return 1;
  201. }
  202.  
  203. public OnPlayerObjectMoved(playerid, objectid)
  204. {
  205. return 1;
  206. }
  207.  
  208. public OnPlayerPickUpPickup(playerid, pickupid)
  209. {
  210. return 1;
  211. }
  212.  
  213. public OnVehicleMod(playerid, vehicleid, componentid)
  214. {
  215. return 1;
  216. }
  217.  
  218. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnPlayerSelectedMenuRow(playerid, row)
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnPlayerExitedMenu(playerid)
  234. {
  235. return 1;
  236. }
  237.  
  238. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  239. {
  240. return 1;
  241. }
  242.  
  243. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  244. {
  245. return 1;
  246. }
  247.  
  248. public OnRconLoginAttempt(ip[], password[], success)
  249. {
  250. return 1;
  251. }
  252.  
  253. public OnPlayerUpdate(playerid)
  254. {
  255. return 1;
  256. }
  257.  
  258. public OnPlayerStreamIn(playerid, forplayerid)
  259. {
  260. return 1;
  261. }
  262.  
  263. public OnPlayerStreamOut(playerid, forplayerid)
  264. {
  265. return 1;
  266. }
  267.  
  268. public OnVehicleStreamIn(vehicleid, forplayerid)
  269. {
  270. return 1;
  271. }
  272.  
  273. public OnVehicleStreamOut(vehicleid, forplayerid)
  274. {
  275. return 1;
  276. }
  277.  
  278. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  279. {
  280. return 1;
  281. }
  282.  
  283. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  284. {
  285. return 1;
  286. }
Advertisement
Add Comment
Please, Sign In to add comment