Advertisement
Guest User

Untitled

a guest
Aug 31st, 2014
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.19 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <foreach>
  5.  
  6. new pBetDice[MAX_PLAYER_NAME];
  7. new pBetAmount[MAX_PLAYER_NAME];
  8. new Highest[MAX_PLAYER_NAME];
  9.  
  10. #if defined FILTERSCRIPT
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n--------------------------------------");
  15. print(" Blank Filterscript by your name here");
  16. print("--------------------------------------\n");
  17. return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22. return 1;
  23. }
  24.  
  25. #else
  26.  
  27. main()
  28. {
  29. print("\n----------------------------------");
  30. print(" Blank Gamemode by your name here");
  31. print("----------------------------------\n");
  32. }
  33.  
  34. #endif
  35.  
  36. public OnGameModeInit()
  37. {
  38. // Don't use these lines if it's a filterscript
  39. SetGameModeText("Blank Script");
  40. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  41. return 1;
  42. }
  43.  
  44. public OnGameModeExit()
  45. {
  46. return 1;
  47. }
  48.  
  49. public OnPlayerRequestClass(playerid, classid)
  50. {
  51. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  52. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  53. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  54. return 1;
  55. }
  56.  
  57. public OnPlayerConnect(playerid)
  58. {
  59. pBetDice[playerid] = 0;
  60. Highest[playerid] = 0;
  61. pBetAmount[playerid] = 0;
  62. return 1;
  63. }
  64.  
  65. public OnPlayerDisconnect(playerid, reason)
  66. {
  67. return 1;
  68. }
  69.  
  70. public OnPlayerSpawn(playerid)
  71. {
  72. return 1;
  73. }
  74.  
  75. public OnPlayerDeath(playerid, killerid, reason)
  76. {
  77. return 1;
  78. }
  79.  
  80. public OnVehicleSpawn(vehicleid)
  81. {
  82. return 1;
  83. }
  84.  
  85. public OnVehicleDeath(vehicleid, killerid)
  86. {
  87. return 1;
  88. }
  89.  
  90. public OnPlayerText(playerid, text[])
  91. {
  92. return 1;
  93. }
  94.  
  95. public OnPlayerCommandText(playerid,cmdtext[])
  96. {
  97. return 0;
  98. }
  99.  
  100. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  101. {
  102. return 1;
  103. }
  104.  
  105. public OnPlayerExitVehicle(playerid, vehicleid)
  106. {
  107. return 1;
  108. }
  109.  
  110. public OnPlayerStateChange(playerid, newstate, oldstate)
  111. {
  112. return 1;
  113. }
  114.  
  115. public OnPlayerEnterCheckpoint(playerid)
  116. {
  117. return 1;
  118. }
  119.  
  120. public OnPlayerLeaveCheckpoint(playerid)
  121. {
  122. return 1;
  123. }
  124.  
  125. public OnPlayerEnterRaceCheckpoint(playerid)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnPlayerLeaveRaceCheckpoint(playerid)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnRconCommand(cmd[])
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnPlayerRequestSpawn(playerid)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnObjectMoved(objectid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerObjectMoved(playerid, objectid)
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnPlayerPickUpPickup(playerid, pickupid)
  156. {
  157. return 1;
  158. }
  159.  
  160. public OnVehicleMod(playerid, vehicleid, componentid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnPlayerSelectedMenuRow(playerid, row)
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnPlayerExitedMenu(playerid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnRconLoginAttempt(ip[], password[], success)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnPlayerUpdate(playerid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnPlayerStreamIn(playerid, forplayerid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnPlayerStreamOut(playerid, forplayerid)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnVehicleStreamIn(vehicleid, forplayerid)
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnVehicleStreamOut(vehicleid, forplayerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  226. {
  227. return 1;
  228. }
  229.  
  230. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  231. {
  232. return 1;
  233. }
  234.  
  235. CMD:money(playerid, params[])
  236. {
  237. GivePlayerMoney(playerid, 1000000);
  238. return 1;
  239. }
  240.  
  241. CMD:diceroll(playerid, params[])
  242. {
  243. new szString[128],
  244. szString2[128],
  245. szPlayerName[MAX_PLAYER_NAME],
  246. iMoney,
  247. iTarget,
  248. iTargetDice = iTarget;
  249. new dice = random(6)+1;
  250. GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
  251. format(szString, sizeof(szString), "* %s rolls a dice that lands on %d.",szPlayerName,dice);
  252. SendClientMessage(playerid, -1, szString);
  253. SendClientMessage(iTargetDice, -1, szString);
  254. Highest[playerid] = dice;
  255. if(Highest[iTargetDice] == 0) return SendClientMessage(iTargetDice, -1, "You need to /diceroll");
  256. else if(Highest[playerid] == 0) return SendClientMessage(playerid, -1, "You need to /diceroll");
  257. else if(Highest[playerid] > Highest[iTargetDice])
  258. {
  259. format(szString, sizeof(szString), "You have lost $%i to %s this was taken from you.", pBetAmount[iTargetDice], szPlayerName);
  260. SendClientMessage(iTargetDice, -1, szString);
  261. format(szString, sizeof(szString), "You have won $%i from %s you have been given this.",pBetAmount[playerid],iTargetDice);
  262. SendClientMessage(playerid, -1, szString);
  263. GivePlayerMoney(iTargetDice, -pBetAmount[iTargetDice]);
  264. GivePlayerMoney(playerid, pBetAmount[playerid]);
  265. }
  266. else if(Highest[iTargetDice] > Highest[playerid])
  267. {
  268. format(szString, sizeof(szString), "You have lost $%i to %s this was taken from you.", pBetAmount[playerid], iTargetDice);
  269. SendClientMessage(playerid, -1, szString);
  270. format(szString, sizeof(szString), "You have won $%i from %s you have been given this.",pBetAmount[iTargetDice], szPlayerName);
  271. SendClientMessage(iTargetDice, -1, szString);
  272. GivePlayerMoney(iTargetDice, pBetAmount[iTargetDice]);
  273. GivePlayerMoney(playerid, -pBetAmount[playerid]);
  274. }
  275. return 1;
  276. }
  277.  
  278. CMD:dicebet(playerid, params[])
  279. {
  280. new iTarget,
  281. iMoney,
  282. szPlayerName[MAX_PLAYER_NAME],
  283. szPlayerName2[MAX_PLAYER_NAME],
  284. szString[256],
  285. iTargetDice = iTarget;
  286.  
  287. GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
  288. GetPlayerName(iTarget, szPlayerName2, sizeof(szPlayerName2));
  289. if(sscanf(params, "ui", iTarget, iMoney)) return SendClientMessage(playerid, -1, "USAGE: /dicebet [playerid/partofname] [money]");
  290. if(GetPlayerMoney(playerid) < iMoney || GetPlayerMoney(iTarget) < iMoney) return SendClientMessage(playerid, -1, "Either you or the other person does not have that amount of money.");
  291. format(szString, sizeof(szString), "%s has offered you to bet $%i (Use /acceptdice to accept)", szPlayerName, iMoney);
  292. SendClientMessage(iTarget, -1, szString);
  293. format(szString, sizeof(szString), "You have offered %s to bet $%i", szPlayerName2, iMoney);
  294. SendClientMessage(playerid, -1, szString);
  295. pBetDice[iTarget] = 255; pBetAmount[iTarget] = iMoney;
  296. pBetDice[playerid] = 255; pBetAmount[playerid] = iMoney;
  297. return 1;
  298. }
  299.  
  300. CMD:acceptdice(playerid, params[])
  301. {
  302. new iTarget,
  303. szPlayerName[MAX_PLAYER_NAME],
  304. szPlayerName2[MAX_PLAYER_NAME],
  305. szString[256],
  306. iMoney = pBetAmount[playerid],
  307. iMoney2 = pBetAmount[iTarget],
  308. BidAccepter;
  309.  
  310. GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
  311. GetPlayerName(iTarget, szPlayerName2, sizeof(szPlayerName2));
  312. if(pBetDice[iTarget] == 255 && pBetDice[playerid] == 255)
  313. {
  314. pBetDice[iTarget] = 1;
  315. pBetDice[playerid] = 1;
  316. format(szString, sizeof(szString), "You accepted %s's Bet of $%i", szPlayerName, iMoney);
  317. SendClientMessage(iTarget, -1, szString);
  318. format(szString, sizeof(szString), "%s has accepted your $%i bet", szPlayerName2, iMoney2);
  319. SendClientMessage(playerid, -1, szString);
  320. BidAccepter = playerid;
  321. }
  322. return 1;
  323. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement