Advertisement
ProDude

Simple Party System

Mar 22nd, 2016
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.37 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 zcmd
  7. #include <Streamer>
  8. #include foreach
  9.  
  10. #define GUNGAME 0xD86EFFFF
  11. #define GUNGAME_ "{E0B6F0}"
  12. #define WHITE 0xFFFFFFFF
  13. #define GREEN 0x255F17FF
  14. #define GRAY 0xBEBEBEFF
  15. #define RED 0xE62525FF
  16. #define RED2_ "{9E1010}"
  17. #define RED2 0x9E1010FF
  18. #define LIGHTRED 0xFF975EFF
  19.  
  20. #define YELLOW 0xFFA600FF
  21. #define YELLOW2 0xFF3C00FF
  22. #define YELLOW3 0xFF5500FF
  23.  
  24. //format(str,sizeof(str),"Teleport - "YELLOW_"%s has teleported to San Fierro "YELLOW3_"(/sf)",pName[playerid]);
  25. #define YELLOW_ "{FFA600}"
  26. #define YELLOW2_ "{FF3C00}"
  27. #define YELLOW3_ "{FF5500}"
  28.  
  29. #define DmCol1 0x419E28FF
  30. #define DmCol1_ "{419E28}"
  31. #define DmCol2 0x70AB5CFF
  32. #define DmCol2_ "{70AB5C}"
  33. #define DmCol3 0xB7FF00FF
  34. #define DmCol3_ "{B7FF00}"
  35.  
  36. #define JOBINFO 0xC8F1FAFF
  37. #define BLUE 0x168BFFFF
  38. #define DARKORANGE 0xC03A00FF
  39. #define ORANGE 0xFF9200FF
  40. #define BLUE2 0x001F6AFF //dark blue
  41. #define LIME 0x9DFF00FF
  42.  
  43. #define PURPLE 0xB10F4EFF
  44. #define SKIN 0xFFA863FF
  45. #define SKIN2 0xB77259FF
  46. #define LIGHTYELLOW 0xFFFF6DFF
  47. #define PINK 0xEB1CC1FF
  48. #define WOOD 0x8B5A2BFF
  49. #define GREENBLUE 0x1FC4A6FF
  50. #define LIGHTBLUE 0x00E5EEFF
  51. #define DARKBLUE 0x0040FFFF
  52. #define BLACK 0x7A7A7AFF
  53. #define DOOM 0xF4A460FF
  54. //#define AdminInfo 0x02EBB8FF
  55. #define AdminInfo 0x00D799FF
  56. #define RACE 0x46E01BFF
  57. #define LIME_ "{9DFF00}"
  58. #define DOOM_ "{F4A460}"
  59. #define WHITE_ "{FFFFFF}"
  60. #define RED_ "{E62525}"
  61. #define LIGHTRED_ "{FF975E}"
  62. #define JOBINFO_ "{C8F1FA}"
  63. #define BLUE_ "{168BFF}"
  64. #define DARK_ORANGE "{C03A00}"
  65. #define ORANGE_ "{FF9200}"
  66. #define BLUE2_ "{001F6A}"
  67. #define PURPLE_ "{B50D61}"
  68. #define SKIN_ "{FFA863}"
  69. #define SKIN2_ "{B77259}"
  70. #define LIGHTYELLOW_ "{FFFF6D}"
  71. #define PINK_ "{EB1CC1}"
  72. #define WOOD_ "{8B5A2B}"
  73. #define GREENBLUE_ "{1FC4A6}"
  74. #define GREEN_ "{255F17}"
  75. #define GRAY_ "{BEBEBE}"
  76. #define LIGHTBLUE_ "{00E5EE}"
  77. #define DARKBLUE_ "{0040FF}"
  78. #define BLACK_ "{7A7A7A}"
  79. #define AdminInfo_ "{00D799}"
  80. #define RACE_ "{46E01B}"
  81.  
  82. #define cornsilk 0xFFED83AA
  83. #define lime 0x9CD13FFF
  84. #define gray 0x9C9C9CAA
  85. #define warning 0xFF0000FF
  86. #define coolblue 0x009DFFAA
  87. #define orange 0xDB9428AA
  88. #define lblue 0xADDEFFFF
  89. #define CWCOL1 0xFF6A00FF
  90. #define CWCOL2 0xFFA666FF
  91.  
  92. #define cornsilk2 "{FBDF89}"
  93. #define lime2 "{9CD13F}"
  94. #define g2 "{9C9C9C}"
  95. #define orange2 "{DB9428}"
  96. #define cb2 "{009DFF}"
  97. #define lblue2 "{ADDEFF}"
  98. #define warning2 "{FF0000}"
  99. #define CWCOL1_ "{FF6A00}"
  100. #define CWCOL2_ "{FFA666}"
  101.  
  102. new xMasPickUp[6];
  103. new Party;
  104. new ShipPartyCount;
  105. new Float:partyX,Float:partyY,Float:partyZ,partyVw;
  106. new Ship1,Ship2,Ship3;
  107. #if defined FILTERSCRIPT
  108. public OnFilterScriptInit()
  109. {
  110.  
  111. return 1;
  112. }
  113. public OnFilterScriptExit()
  114. {
  115. return 1;
  116. }
  117.  
  118. #else
  119.  
  120.  
  121. #endif
  122.  
  123. public OnGameModeInit()
  124. {
  125. for(new x=0; x<sizeof(xMasPickUp); x++) xMasPickUp[x]=-255;
  126. Ship1 = CreateObject(10793, -1604.04, 22.73, 35.57, 0.00, 0.00, 45.00);
  127. Ship2 = CreateObject(10794, -1550.83, 75.93, 7.00, 0.00, 0.00, 45.00);
  128. Ship3 = CreateObject(10795, -1552.314, 74.4206, 17.05, 0.00, 0.00, 45.00);
  129. AttachObjectToObject(Ship1, Ship2, -75.65, 0.0, 28.5, 0.0, 0.0, 0.0, 1);
  130. AttachObjectToObject(Ship2, Ship3, 2.8, 0, -10.0, 0.0, 0.0, 0.0, 1);
  131. return 1;
  132. }
  133. stock alvl(playerid)
  134. {
  135. return CallRemoteFunction("AdminLevel", "d", playerid);
  136. }
  137. forward resetship();
  138. public resetship()
  139. {
  140. SetObjectPos(Ship1,-1604.04, 22.73, 35.57);
  141. SetObjectPos(Ship2,-1550.83, 75.93, 7.00);
  142. SetObjectPos(Ship3,-1552.314, 74.4206, 17.05);
  143.  
  144. SetObjectRot(Ship1,0.00, 0.00, 45.00);
  145. SetObjectRot(Ship2,0.00, 0.00, 45.00);
  146. SetObjectRot(Ship3,0.00, 0.00, 45.00);
  147. AttachObjectToObject(Ship1, Ship2, -75.65, 0.0, 28.5, 0.0, 0.0, 0.0, 1);
  148. AttachObjectToObject(Ship2, Ship3, 2.7, 0, -10.0, 0.0, 0.0, 0.0, 1);
  149. Party = 0;
  150. return 1;
  151. }
  152.  
  153. public OnGameModeExit()
  154. {
  155. return 1;
  156. }
  157. CMD:startparty(playerid)
  158. {
  159. if(alvl(playerid) < 4) return 0;
  160. ShowPlayerDialog(playerid,4544,DIALOG_STYLE_LIST,"Start Party","1.Start a normal party in your position \n2.Start the THE TITANIC party\n3.xMas party","Start","Exit");
  161. return 1;
  162. }
  163. CMD:party(playerid)
  164. {
  165. if(Party == 0) return SendClientMessage(playerid,RED,"No party has been started yet");
  166. else if(Party == 2) return SendClientMessage(playerid,RED,"The party has already been started");
  167. else
  168. {
  169. switch(random(5))
  170. {
  171. case 0:SetPlayerPos(playerid,partyX,partyY,partyZ);
  172. case 1:SetPlayerPos(playerid,partyX+1,partyY,partyZ);
  173. case 2:SetPlayerPos(playerid,partyX,partyY+1,partyZ);
  174. case 3:SetPlayerPos(playerid,partyX-1,partyY,partyZ);
  175. case 4:SetPlayerPos(playerid,partyX,partyY-1,partyZ);
  176.  
  177. }
  178. }
  179. SetPlayerVirtualWorld(playerid,partyVw);
  180.  
  181. return 1;
  182. }
  183.  
  184. new Float:Titanic1Coords[][6] = //93
  185. {
  186. {-1415.2278, 178.8590, 35.5700 , 0.0000, 0.0000, 45.0000},
  187. {-1046.8055, 545.8651, 35.5700, 0.0000, 0.0000, 45.0000},
  188. {-1068.0116, 597.9653, 35.5700, 0.0000, 0.0000, 0.0000},
  189. {-984.4982, 597.2338, 35.5700,0.0000, 0.0000, -14.0000},
  190. {-693.9249, 514.3314, 35.5700, 0.0000, 0.0000, -16.0000},
  191. {-343.6650, 386.5757, 35.5700,0.0000, 0.0000, -5.0000}, //start the shit
  192. {99.7249, 310.9523, 35.5700,0.0000, 0.0000, 10.0000},//crashed
  193. {115.8157, 276.7807, 35.5700,0.0000, 0.0000, 40.0000},
  194. {290.2462, 418.0674, 71.3000,0.0000, 50.0000, 40.0000},
  195. {290.2462, 418.0674, 29.9000,0.0000, 50.0000, 40.0000}
  196. };
  197. new Float:Titanic2Coords[][6] = //94
  198. {
  199. {-1361.5927, 232.4753, 7.0000, 0.0000, 0.0000, 45.0000},
  200. {-993.9478, 598.6451, 7.0000, 0.0000, 0.0000, 45.0000},
  201. {-993.3140, 597.5258, 7.0000, 0.0000, 0.0000, 0.0000},
  202. {-911.5853, 578.8046, 7.0000,0.0000, 0.0000, -14.0000},
  203. {-621.7428, 493.4192, 7.0000,0.0000, 0.0000, -16.0000},
  204. {-268.5040, 379.8922, 7.0000,0.0000, 0.0000, -5.0000}, //start the shit
  205. {174.1780, 324.1174, 7.0000,0.0000, 0.0000, 10.0000},//crashed
  206. {173.6760, 324.8739, 7.0000,0.0000, 0.0000, 40.0000},
  207. {313.2526, 437.4551, 1.0000,0.0000, 50.0000, 40.0000},
  208. {313.2526, 437.4551, -39.0000,0.0000, 50.0000, 40.0000}
  209. };
  210. new Float:Titanic3Coords[][6] = //95
  211. {
  212. {-1363.3668, 230.5191, 17.0500, 0.0000, 0.0000, 45.0000},
  213. {-995.2252, 597.4672, 17.0500, 0.0000, 0.0000, 45.0000},
  214. {-995.1288, 597.9356, 17.0500, 0.0000, 0.0000, 0.0000},
  215. {-913.5530, 579.4688, 17.0500,0.0000, 0.0000, -14.0000},
  216. {-624.0149, 494.0974, 17.0500,0.0000, 0.0000, -16.0000},
  217. {-270.9716, 380.1544, 17.0500, 0.0000, 0.0000, -5.0000}, // start the shit
  218. {171.8441, 323.7453, 17.0500,0.0000, 0.0000, 10.0000}, //crashed
  219. {171.8441, 323.7453, 17.0500,0.0000, 0.0000, 40.0000},
  220. {315.9788, 439.8584, 4.0000,0.0000, 50.0000, 40.0000},
  221. {315.9645, 439.8445, -37.0000,0.0000, 50.0000, 40.0000}
  222. };
  223. stock PlayerName(playerid)
  224. {
  225. new pname[MAX_PLAYER_NAME];
  226. GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  227. return pname;
  228. }
  229. CMD:endparty(playerid)
  230. {
  231. if(alvl(playerid) < 4) return 0;
  232. if((Party == 0)) return SendClientMessage(playerid,RED,"No party has been started yet");
  233. new str[75];
  234. format(str,sizeof(str),"%s has ended the party",PlayerName(playerid));
  235. SendClientMessageToAll(GREENBLUE,str);
  236. Party=0;
  237. for(new x=0; x<sizeof(xMasPickUp); x++) DestroyPickup(xMasPickUp[x]),xMasPickUp[x]=-255;
  238. return 1;
  239. }
  240.  
  241. public OnObjectMoved(objectid)
  242. {
  243. if(objectid == Ship2)
  244. {
  245. ShipPartyCount++;
  246. MoveObject(Ship1,Titanic1Coords[ShipPartyCount][0],Titanic1Coords[ShipPartyCount][1],Titanic1Coords[ShipPartyCount][2],10.00,Titanic1Coords[ShipPartyCount][3],Titanic1Coords[ShipPartyCount][4],Titanic1Coords[ShipPartyCount][5]);
  247. MoveObject(Ship2,Titanic2Coords[ShipPartyCount][0],Titanic2Coords[ShipPartyCount][1],Titanic2Coords[ShipPartyCount][2],10.00,Titanic2Coords[ShipPartyCount][3],Titanic2Coords[ShipPartyCount][4],Titanic2Coords[ShipPartyCount][5]);
  248. MoveObject(Ship3,Titanic3Coords[ShipPartyCount][0],Titanic3Coords[ShipPartyCount][1],Titanic3Coords[ShipPartyCount][2],10.00,Titanic3Coords[ShipPartyCount][3],Titanic3Coords[ShipPartyCount][4],Titanic3Coords[ShipPartyCount][5]);
  249. if(ShipPartyCount == 5)
  250. {
  251. new Float:x,Float:y,Float:z;
  252. GetObjectPos(Ship2,x,y,z);
  253. foreach(Player,playerid)
  254. {
  255. if(IsPlayerInRangeOfPoint(playerid,100.00,x,y,z))
  256. {
  257. SetPlayerWeather(playerid ,16);
  258. SendClientMessage(playerid,RED,"the weather has started to change");
  259. }
  260. }
  261. }
  262. if(ShipPartyCount == 6)
  263. {
  264. new Float:x,Float:y,Float:z;
  265. GetObjectPos(Ship2,x,y,z);
  266. foreach(Player,playerid)
  267. {
  268. if(IsPlayerInRangeOfPoint(playerid,100.00,x,y,z))
  269. {
  270. StopAudioStreamForPlayer(playerid);
  271. PlayAudioStreamForPlayer(playerid,"http://dl.dropbox.com/u/52869044/Alarm%20Sound%20Navy.mp3");
  272. SendClientMessage(playerid,RED,"DANGER......The Ship Has Crashed ");
  273. }
  274.  
  275. }
  276. }
  277. if(ShipPartyCount == 9)
  278. {
  279. SetTimer("resetship",10*1000,false);
  280.  
  281. }
  282. }
  283. return 1;
  284. }
  285.  
  286. forward moveship(playerid);
  287. public moveship(playerid)
  288. {
  289. SendClientMessageToAll(BLUE,"The titanic party has been started");
  290. MoveObject(Ship1,Titanic1Coords[0][0],Titanic1Coords[0][1],Titanic1Coords[0][2],5.00,Titanic1Coords[0][3],Titanic1Coords[0][4],Titanic1Coords[0][5]);
  291. MoveObject(Ship2,Titanic2Coords[0][0],Titanic2Coords[0][1],Titanic2Coords[0][2],5.00,Titanic2Coords[0][3],Titanic2Coords[0][4],Titanic2Coords[0][5]);
  292. MoveObject(Ship3,Titanic3Coords[0][0],Titanic3Coords[0][1],Titanic3Coords[0][2],5.00,Titanic3Coords[0][3],Titanic3Coords[0][4],Titanic3Coords[0][5]);
  293. ShipPartyCount = 1;
  294. Party = 2;
  295. new Float:x,Float:y,Float:z;
  296. GetObjectPos(Ship2,x,y,z);
  297. foreach(Player,playerid)
  298. {
  299. if(IsPlayerInRangeOfPoint(playerid,100.00,x,y,z))
  300. {
  301. StopAudioStreamForPlayer(playerid);
  302. PlayAudioStreamForPlayer(playerid,"http://dl.dropbox.com/u/52869044/Server%20Songs/Titanic%20remix%20THE%20BEST%20EVER%21.mp3");
  303. }
  304. }
  305. }
  306.  
  307. stock StartShipParty(playerid)
  308. {
  309. new str[128];
  310. format(str,sizeof(str),"%s has started "BLUE_"THE TITANIC"LIGHTBLUE_" party",PlayerName(playerid));
  311. SendClientMessageToAll(LIGHTBLUE,str);
  312. SendClientMessageToAll(GREENBLUE,"The ship will move in 30 seconds, type "PINK_"(/party)"GREENBLUE_" to join" );
  313. SetTimer("moveship",30*1000,false);
  314. if(IsValidObject(Ship1))DestroyObject(Ship1);
  315. if(IsValidObject(Ship2))DestroyObject(Ship2);
  316. if(IsValidObject(Ship3))DestroyObject(Ship3);
  317. Ship1 = CreateObject(10793, -1604.04, 22.73, 35.57, 0.00, 0.00, 45.00);
  318. Ship2 = CreateObject(10794, -1550.83, 75.93, 7.00, 0.00, 0.00, 45.00);
  319. Ship3 = CreateObject(10795, -1552.314, 74.4206, 17.05, 0.00, 0.00, 45.00);
  320. AttachObjectToObject(Ship1, Ship2, -75.65, 0.0, 28.5, 0.0, 0.0, 0.0, 1);
  321. AttachObjectToObject(Ship2, Ship3, 2.7, 0, -10.0, 0.0, 0.0, 0.0, 1);
  322. }
  323. stock StartxMasParty(playerid)
  324. {
  325. new str[128];
  326. format(str,sizeof(str),"%s has started the"BLUE_" xMas"LIGHTBLUE_" party",PlayerName(playerid));
  327. SendClientMessageToAll(LIGHTBLUE,str);
  328.  
  329. xMasPickUp[0] = CreateDynamicObject(19057, 972.8822,-2483.4968,70.5924,0.0,0.0,0.0,0);
  330. xMasPickUp[1] = CreateDynamicObject(19057, 981.8885,-2495.0662,70.7624,0.0,0.0,0.0,0);
  331. xMasPickUp[2] = CreateDynamicObject(19056, 973.0527,-2510.1470,70.8676,0.0,0.0,0.0,0);
  332. xMasPickUp[3] = CreateDynamicObject(19058, 961.7491,-2507.1165,70.8982,0.0,0.0,0.0,0);
  333. xMasPickUp[4] = CreateDynamicObject(19055, 955.5288,-2497.6960,70.2119,0.0,0.0,0.0,0);
  334. xMasPickUp[5] = CreateDynamicObject(19055, 962.6249,-2495.0610,70.2687,0.0,0.0,0.0,0);
  335. for(new i=0;i<6;i++)
  336. {
  337. new Float:x,Float:y,Float:z;
  338. GetDynamicObjectPos(xMasPickUp[i],x,y,z);
  339. MoveDynamicObject(xMasPickUp[i],x,y,55.0,2.00);
  340. }
  341. }
  342.  
  343. public OnPlayerObjectMoved(playerid, objectid)
  344. {
  345. return 1;
  346. }
  347.  
  348. public OnPlayerPickUpPickup(playerid, pickupid)
  349. {
  350. for(new x=0;x<6;x++)
  351. {
  352. if(pickupid ==xMasPickUp[x])
  353. {
  354. switch(random(5))
  355. {
  356. case 0:
  357. {
  358. GivePlayerMoney(playerid,50000);
  359. }
  360. case 1:
  361. {
  362. GameTextForPlayer(playerid,"~b~Santa Hat",1000, 0);
  363. SetPlayerAttachedObject(playerid, 2, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
  364. }
  365. case 2:
  366. {
  367. GivePlayerWeapon(playerid, 16, 64);
  368. GameTextForPlayer(playerid,"~r~BOMB",1000, 0);
  369. }
  370. case 3:
  371. {
  372. GameTextForPlayer(playerid,"~p~Dildo",1000, 0);
  373. SetPlayerAttachedObject( playerid, 2, 19086, 8, -0.049768, -0.014062, -0.108385, 87.458297, 263.478149, 184.123764, 0.622413, 1.041609, 1.012785 ); // ChainsawDildo1 - lolatdick
  374.  
  375. }
  376. case 4:
  377. {
  378. GivePlayerWeapon(playerid, 26, 64);
  379. }
  380. }
  381. break;
  382. }
  383. }
  384. return 1;
  385. }
  386.  
  387. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  388. {
  389. if(response)// They pressed the first button.
  390. {
  391. switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
  392. {
  393. case 4544:// Our dialog!
  394. {
  395. switch(listitem)// Checking which listitem was selected
  396. {
  397. case 0:
  398. {
  399. new Float:x,Float:y,Float:z;
  400. GetPlayerPos(playerid,x,y,z);
  401. partyX = x,partyY = y, partyZ = z,partyVw = GetPlayerVirtualWorld(playerid);
  402. Party = 1;
  403. new str[74];
  404. format(str,sizeof(str),"%s has started a party",PlayerName(playerid));
  405. SendClientMessageToAll(LIGHTBLUE,str);
  406. SendClientMessageToAll(LIGHTBLUE,"Type (/party) to join it");
  407. }
  408. case 1:
  409. {
  410. partyX = -1563.1523,partyY = 63.7251, partyZ = 17.3312;
  411. partyVw=0;
  412. StartShipParty(playerid);
  413. Party = 1;
  414. }
  415. case 2:
  416. {
  417. partyX = 961.3387,partyY = -2487.3472, partyZ = 55.2720;
  418. partyVw=0;
  419. StartxMasParty(playerid);
  420. Party = 1;
  421. }
  422. }
  423. }
  424. }
  425. }
  426. return 1;
  427. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement