Advertisement
Guest User

Samp - Votesystem

a guest
Aug 27th, 2012
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.63 KB | None | 0 0
  1. /*******************************************************************************
  2. Solltest du ein Filterscript erstellen, so schreibe unten bei Define über dem
  3. #if defined FILTERSCRIPT einfach folgendes:
  4. #define FILTERSCRIPT
  5. Falls es ein Gamemode wird, so schreibe es nicht dort hin!
  6.  
  7. Scriptname: -
  8. Version: -
  9. Kategorie: -
  10. Inhalt: -
  11. Beschreibung: -
  12. *******************************************************************************/
  13.  
  14. //Include
  15. #include <a_samp>
  16.  
  17. //Define
  18. #define FILTERSCRIPT
  19. #if defined FILTERSCRIPT
  20. #define DIALOG_VOTEADM 1
  21. #define DIALOG_VOTEUSR 2 // Zahlen bitte entsprechend ändern
  22. #define DIALOG_VOTEANZ 3
  23. #define DIALOG_VSTATS 4
  24. #define DIALOG_VBUTTONONE 5
  25. #define DIALOG_VBUTTONTWO 6
  26.  
  27. //New
  28. new countja;
  29. new countnein;
  30. new itstring[128] = "Keine Frage vorhanden.";
  31. new buttonone[128] = "None";
  32. new buttontwo[128] = "None";
  33.  
  34. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  35. public OnFilterScriptInit()
  36. {
  37. print("\n--------------------------------------");
  38. print(" Votingsystem by Sonderzeichen started");
  39. print("--------------------------------------\n");
  40. return 1;
  41. }
  42.  
  43. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  44. public OnFilterScriptExit()
  45. {
  46. print("\n--------------------------------------");
  47. print(" Votingsystem by Sonderzeichen stopped");
  48. print("--------------------------------------\n");
  49. return 1;
  50. }
  51.  
  52. #else
  53.  
  54. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  55. main()
  56. {
  57. print("\n----------------------------------");
  58. print(" Blank Gamemode by your name here");
  59. print("----------------------------------\n");
  60. }
  61.  
  62. #endif
  63.  
  64. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  65. public OnGameModeInit()
  66. {
  67. //Du darfst das hier nicht benutzen, wenn du ein Filterscript erstellst!
  68. SetGameModeText("Blank Script");
  69. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  70. return 1;
  71. }
  72.  
  73. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  74. public OnGameModeExit()
  75. {
  76. return 1;
  77. }
  78.  
  79. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  80. public OnPlayerRequestClass(playerid, classid)
  81. {
  82. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  83. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  84. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  85. return 1;
  86. }
  87.  
  88. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  89. public OnPlayerConnect(playerid)
  90. {
  91. return 1;
  92. }
  93.  
  94. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  95. public OnPlayerDisconnect(playerid, reason)
  96. {
  97. return 1;
  98. }
  99.  
  100. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  101. public OnPlayerSpawn(playerid)
  102. {
  103. return 1;
  104. }
  105.  
  106. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  107. public OnPlayerDeath(playerid, killerid, reason)
  108. {
  109. return 1;
  110. }
  111.  
  112. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  113. public OnVehicleSpawn(vehicleid)
  114. {
  115. return 1;
  116. }
  117.  
  118. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  119. public OnVehicleDeath(vehicleid, killerid)
  120. {
  121. return 1;
  122. }
  123.  
  124. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  125. public OnPlayerText(playerid, text[])
  126. {
  127. return 1;
  128. }
  129.  
  130. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  131. public OnPlayerCommandText(playerid, cmdtext[])
  132. {
  133. if (strcmp("/cvote", cmdtext, true, 10) == 0)
  134. {
  135. countja = 0;
  136. countnein = 0;
  137. ShowPlayerDialog(playerid, DIALOG_VOTEADM, DIALOG_STYLE_INPUT, "[VS] Frage eingeben", "Bitte geben Sie die Frage ein.\nDie Beschriftung der beiden Antwortbuttons können Sie gleich festlegen.", "Ok", "Abbr.");
  138. return 1;
  139. }
  140.  
  141. if (strcmp("/vote", cmdtext, true, 10) == 0)
  142. {
  143. ShowPlayerDialog(playerid, DIALOG_VOTEUSR, DIALOG_STYLE_MSGBOX,"[VS] Votesystem", itstring, buttonone, buttontwo);
  144. return 1;
  145. }
  146.  
  147. if (strcmp("/vstats", cmdtext, true, 10) == 0)
  148. {
  149. new string[64];
  150. format(string, sizeof(string), "Frage: %s\n%s: %d\n%s: %d", itstring, buttonone, countja, buttontwo, countnein);
  151. ShowPlayerDialog(playerid, DIALOG_VSTATS, DIALOG_STYLE_MSGBOX, "[VS] Statisktik", string, "Ok", "Abbr.");
  152. return 1;
  153. }
  154. return 0;
  155. }
  156.  
  157. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  158. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  159. {
  160. return 1;
  161. }
  162.  
  163. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  164. public OnPlayerExitVehicle(playerid, vehicleid)
  165. {
  166. return 1;
  167. }
  168.  
  169. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  170. public OnPlayerStateChange(playerid, newstate, oldstate)
  171. {
  172. return 1;
  173. }
  174.  
  175. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  176. public OnPlayerEnterCheckpoint(playerid)
  177. {
  178. return 1;
  179. }
  180.  
  181. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  182. public OnPlayerLeaveCheckpoint(playerid)
  183. {
  184. return 1;
  185. }
  186.  
  187. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  188. public OnPlayerEnterRaceCheckpoint(playerid)
  189. {
  190. return 1;
  191. }
  192.  
  193. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  194. public OnPlayerLeaveRaceCheckpoint(playerid)
  195. {
  196. return 1;
  197. }
  198.  
  199. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  200. public OnRconCommand(cmd[])
  201. {
  202. return 1;
  203. }
  204.  
  205. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  206. public OnPlayerRequestSpawn(playerid)
  207. {
  208. return 1;
  209. }
  210.  
  211. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  212. public OnObjectMoved(objectid)
  213. {
  214. return 1;
  215. }
  216.  
  217. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  218. public OnPlayerObjectMoved(playerid, objectid)
  219. {
  220. return 1;
  221. }
  222.  
  223. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  224. public OnPlayerPickUpPickup(playerid, pickupid)
  225. {
  226. return 1;
  227. }
  228.  
  229. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  230. public OnVehicleMod(playerid, vehicleid, componentid)
  231. {
  232. return 1;
  233. }
  234.  
  235. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  236. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  237. {
  238. return 1;
  239. }
  240.  
  241. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  242. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  243. {
  244. return 1;
  245. }
  246.  
  247. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  248. public OnPlayerSelectedMenuRow(playerid, row)
  249. {
  250. return 1;
  251. }
  252.  
  253. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  254. public OnPlayerExitedMenu(playerid)
  255. {
  256. return 1;
  257. }
  258.  
  259. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  260. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  261. {
  262. return 1;
  263. }
  264.  
  265. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  266. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  267. {
  268. return 1;
  269. }
  270.  
  271. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  272. public OnRconLoginAttempt(ip[], password[], success)
  273. {
  274. return 1;
  275. }
  276.  
  277. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  278. public OnPlayerUpdate(playerid)
  279. {
  280. return 1;
  281. }
  282.  
  283. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  284. public OnPlayerStreamIn(playerid, forplayerid)
  285. {
  286. return 1;
  287. }
  288.  
  289. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  290. public OnPlayerStreamOut(playerid, forplayerid)
  291. {
  292. return 1;
  293. }
  294.  
  295. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  296. public OnVehicleStreamIn(vehicleid, forplayerid)
  297. {
  298. return 1;
  299. }
  300.  
  301. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  302. public OnVehicleStreamOut(vehicleid, forplayerid)
  303. {
  304. return 1;
  305. }
  306.  
  307. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  308. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  309. {
  310. if(dialogid == DIALOG_VOTEADM)
  311. {
  312. if(response == 1)
  313. {
  314. format(itstring, sizeof(itstring), "%s", inputtext);
  315. ShowPlayerDialog(playerid, DIALOG_VBUTTONONE, DIALOG_STYLE_INPUT, "[VS] Beschriftung vom ersten Button", "Bitte legen Sie die Beschriftung vom ersten Button fest.", "Ok", "Abbr.");
  316. }
  317. }
  318. if(dialogid == DIALOG_VBUTTONONE)
  319. {
  320. if(response == 1)
  321. {
  322. new string[128];
  323. format(string, sizeof(string), "%s", inputtext);
  324. buttonone = string;
  325. ShowPlayerDialog(playerid, DIALOG_VBUTTONTWO, DIALOG_STYLE_INPUT, "[VS] Beschriftung vom zweiten Button", "Bitte legen Sie die Beschriftung vom zweiten Button fest.", "Ok", "Abbr.");
  326. }
  327. }
  328. if(dialogid == DIALOG_VBUTTONTWO)
  329. {
  330. if(response == 1)
  331. {
  332. for(new i=0; i < MAX_PLAYERS; i++)
  333. {
  334. new string[128];
  335. format(string, sizeof(string), "%s", inputtext);
  336. buttontwo = string;
  337. ShowPlayerDialog(i, DIALOG_VOTEUSR, DIALOG_STYLE_MSGBOX, "[VS] Votesystem", itstring, buttonone, buttontwo);
  338. }
  339. }
  340. }
  341. if(dialogid == DIALOG_VOTEUSR)
  342. {
  343. if(response == 0)
  344. {
  345. countnein +=1;
  346. }
  347. if(response == 1)
  348. {
  349. countja +=1;
  350. }
  351. }
  352. return 1;
  353. }
  354.  
  355. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  356. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  357. {
  358. return 1;
  359. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement