Advertisement
Guest User

cale

a guest
Feb 26th, 2008
919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.14 KB | None | 0 0
  1. #include <a_samp>
  2. new door;
  3. #define COLOR_GREEN 0x33AA33AA
  4. #define COLOR_RED 0xAA3333AA
  5.  
  6.  
  7. #define COLOR_RED 0xAA3333AA
  8.  
  9. #define COLOR_GREY 0xAFAFAFAA
  10.  
  11. #define COLOR_GREEN 0x33AA33AA
  12.  
  13. #define COLOR_YELLOW 0xFFFF00AA
  14.  
  15. #define COLOR_WHITE 0xFFFFFFAA
  16.  
  17. #define COLOR_BLUE 0x0000BBAA
  18.  
  19. #define COLOR_LIGHTBLUE 0x33CCFFAA
  20.  
  21. #define COLOR_ORANGE 0xFF9900AA
  22.  
  23. #define COLOR_LIME 0x10F441AA
  24.  
  25. #define COLOR_MAGENTA 0xFF00FFFF
  26.  
  27. #define COLOR_NAVY 0x000080AA
  28.  
  29. #define COLOR_AQUA 0xF0F8FFAA
  30.  
  31. #define COLOR_CRIMSON 0xDC143CAA
  32.  
  33. #define COLOR_FLBLUE 0x6495EDAA
  34.  
  35. #define COLOR_BISQUE 0xFFE4C4AA
  36.  
  37. #define COLOR_BLACK 0x000000AA
  38.  
  39. #define COLOR_CHARTREUSE 0x7FFF00AA
  40.  
  41. #define COLOR_BROWN 0xA52A2AAA
  42.  
  43. #define COLOR_CORAL 0xFF7F50AA
  44.  
  45. #define COLOR_GOLD 0xB8860BAA
  46.  
  47. #define COLOR_GREENYELLOW 0xADFF2FAA
  48.  
  49. #define COLOR_INDIGO 0x4B00B0AA
  50.  
  51. #define COLOR_IVORY 0xFFFF82AA
  52.  
  53. #define COLOR_LAWNGREEN 0x7CFC00AA
  54.  
  55. #define COLOR_LIMEGREEN 0x32CD32AA
  56.  
  57. #define COLOR_MIDNIGHTBLUE 0x191970AA
  58.  
  59. #define COLOR_MAROON 0x800000AA
  60.  
  61. #define COLOR_OLIVE 0x808000AA
  62.  
  63. #define COLOR_ORANGERED 0xFF4500AA
  64.  
  65. #define COLOR_PINK 0xFFC0CBAA
  66.  
  67. #define COLOR_SPRINGGREEN 0x00FF7FAA
  68.  
  69. #define COLOR_TOMATO 0xFF6347AA
  70.  
  71. #define COLOR_YELLOWGREEN 0x9ACD32AA
  72.  
  73. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  74.  
  75. #define COLOR_MEDIUMMAGENTA 0x8B008BAA
  76.  
  77. #define COLOR_BRIGHTRED 0xDC143CAA
  78.  
  79. #define COLOR_SYSTEM 0xEFEFF7AA
  80.  
  81. #define COLOR_PURPLE 0x330066AA
  82.  
  83.  
  84. #if defined FILTERSCRIPT
  85.  
  86. public OnFilterScriptInit()
  87. {
  88. print("\n--------------------------------------");
  89. print(" jail made by cale");
  90. print("--------------------------------------\n");
  91. return 1;
  92. }
  93.  
  94. public OnFilterScriptExit()
  95. {
  96. return 1;
  97. }
  98.  
  99. #else
  100.  
  101.  
  102. #endif
  103.  
  104. public OnGameModeInit()
  105. {
  106. CreateObject(969, 2481.920654, -1662.276733, 12.410629, 0.0000, 0.0000, 277.3906);
  107. CreateObject(969, 2490.467285, -1660.839478, 12.327827, 0.0000, 358.2811, 186.2903);
  108. CreateObject(969, 2483.212402, -1670.867798, 12.402826, 0.0000, 359.1406, 318.5408);
  109. CreateObject(969, 2485.501221, -1668.897217, 15.452816, 87.6625, 10.3132, 309.0871);
  110. CreateObject(969, 2484.925537, -1661.584717, 15.560627, 91.1003, 32.6586, 248.0671);
  111. CreateObject(969, 2487.844482, -1661.080566, 15.527813, 91.1003, 31.7992, 248.0671);
  112. CreateObject(969, 2487.277588, -1666.721924, 15.402822, 91.1003, 29.2208, 291.0388);
  113. CreateObject(969, 2488.957520, -1664.598022, 15.577820, 91.1003, 29.2208, 291.0388);
  114. CreateObject(969, 2490.590088, -1660.637329, 15.577827, 91.1003, 29.2208, 248.9258);
  115. CreateObject(969, 2498.165039, -1674.880127, 12.230127, 0.0000, 0.8594, 191.4461);
  116. CreateObject(969, 2490.553223, -1660.875366, 12.277828, 0.0000, 359.1406, 279.1097);
  117. CreateObject(2634, 2492.714600, -1669.627930, 13.480176, 0.0000, 0.0000, 327.3414);
  118. CreateObject(1225, 2482.207275, -1662.126221, 12.749505, 0.0000, 0.0000, 0.0000);
  119. CreateObject(1225, 2482.157471, -1662.126953, 13.824496, 0.0000, 0.0000, 0.0000);
  120. CreateObject(1225, 2482.442871, -1662.809448, 12.721868, 0.0000, 0.0000, 0.0000);
  121. CreateObject(1225, 2483.114990, -1662.078857, 12.741702, 0.0000, 0.0000, 0.0000);
  122. CreateObject(969, 2503.541016, -1668.729126, 12.502831, 0.0000, 0.8594, 191.4461);
  123. CreateObject(969, 2503.540527, -1668.837769, 12.529856, 0.0000, 0.8594, 301.3504);
  124. CreateObject(969, 2498.163574, -1674.880371, 12.283159, 2.5783, 358.2811, 327.9927);
  125. CreateObject(969, 2508.573975, -1676.614990, 12.713753, 0.0000, 359.1406, 185.3267);
  126. CreateObject(969, 2494.252197, -1669.630127, 15.427835, 274.0563, 331.6386, 214.5467);
  127. CreateObject(969, 2494.375244, -1669.417480, 15.202822, 274.0563, 311.8715, 222.2809);
  128. CreateObject(969, 2496.936279, -1669.488525, 15.262341, 268.8997, 311.8715, 225.7187);
  129. CreateObject(969, 2500.099121, -1668.879150, 15.115545, 274.0563, 310.1527, 223.9998);
  130. CreateObject(969, 2503.150391, -1668.464600, 15.234543, 274.0563, 310.1527, 223.9998);
  131. CreateObject(969, 2500.624268, -1670.890869, 15.003172, 274.0563, 326.4820, 272.9879);
  132.  
  133.  
  134. door = CreateObject(2634, 2494.498779, -1670.283569, 13.480176, 0.0000, 0.0000, 331.6386);
  135. }
  136.  
  137.  
  138. public OnPlayerText(playerid, text[])
  139. {
  140. return 1;
  141. }
  142.  
  143. public OnPlayerPrivmsg(playerid, recieverid, text[])
  144. {
  145. return 1;
  146. }
  147.  
  148. public OnPlayerCommandText(playerid, cmdtext[])
  149. {
  150. new cmd[256];
  151. new idx;
  152. cmd = strtok(cmdtext, idx);
  153.  
  154. //jail
  155. if (strcmp(cmd, "/grovejail", true) == 0)
  156. {
  157. if (IsPlayerAdmin(playerid))
  158. {
  159. new dir[256];
  160. dir = strtok(cmdtext, idx);
  161.  
  162. if (!strlen(dir))
  163. {
  164. SendClientMessage(playerid, COLOR_RED, "USAGE: /grovejail [id]");
  165. return 1;
  166. }
  167.  
  168. new giveplayerid = strval(dir);
  169. if (IsPlayerConnected(giveplayerid))
  170. {
  171.  
  172. SetPlayerPos(giveplayerid, 2500.624268, -1670.890869, 15.003172);
  173. new giveplayername[MAX_PLAYER_NAME];
  174. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  175. new senderplayername[MAX_PLAYER_NAME];
  176. GetPlayerName(playerid, senderplayername, sizeof(senderplayername));
  177. new string[256];
  178. format(string, sizeof(string), " %s has been jailed", giveplayername);
  179. SendClientMessage(playerid, COLOR_GREEN, string);
  180. format(string, sizeof(string), "You Have Been Jailed by %s , ", senderplayername);
  181. SendClientMessage(giveplayerid, COLOR_GREEN, string);
  182. }
  183. else
  184. {
  185. new string[256];
  186. format(string, sizeof(string), " %d, is not an invalid player.", giveplayerid);
  187. SendClientMessage(playerid, COLOR_RED, string);
  188. }
  189. return 1;
  190. }
  191. else
  192. {
  193. SendClientMessage(playerid, COLOR_RED, "ADMIN ONLY!!!!!!!!");
  194. }
  195. }
  196. //unjail
  197. if (strcmp(cmd, "/groveunjail", true) == 0)
  198. {
  199. if (IsPlayerAdmin(playerid))
  200. {
  201. new dir[256];
  202. dir = strtok(cmdtext, idx);
  203.  
  204. if (!strlen(dir))
  205. {
  206. SendClientMessage(playerid, COLOR_RED, "USAGE: /groveunjail [id]");
  207. return 1;
  208. }
  209.  
  210. new giveplayerid = strval(dir);
  211. if (IsPlayerConnected(giveplayerid))
  212. {
  213. SetPlayerInterior(giveplayerid, 0);
  214. SetPlayerPos(giveplayerid, 2500.624268, -1670.890869, 40.003172);
  215. GivePlayerMoney(giveplayerid, (0 - 2500));
  216. new giveplayername[MAX_PLAYER_NAME];
  217. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  218. new senderplayername[MAX_PLAYER_NAME];
  219. GetPlayerName(playerid, senderplayername, sizeof(senderplayername));
  220. new string[256];
  221. format(string, sizeof(string), "You Have Released %s from The Jail!", giveplayername);
  222. SendClientMessage(playerid, COLOR_GREEN, string);
  223. format(string, sizeof(string), "You have been set free and fined by %s for $2500!", senderplayername);
  224. SendClientMessage(giveplayerid, COLOR_GREEN, string);
  225. }
  226. else
  227. {
  228. new string[256];
  229. format(string, sizeof(string), "%d is not a valid id ", giveplayerid);
  230. SendClientMessage(playerid, COLOR_RED, string);
  231. }
  232. return 1;
  233. }
  234. else
  235. {
  236. SendClientMessage(playerid, COLOR_RED, "ADMINS ONLY!!!!!");
  237. }
  238.  
  239.  
  240. return 1;
  241. }
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. if (strcmp(cmdtext, "/opendoor", true) == 0)
  250. {
  251. if(IsPlayerAdmin(playerid) == 1)
  252. {
  253. MoveObject(door, 2492.714600, -1669.627930, 13.480176, 30);
  254.  
  255. SendClientMessage(playerid, 0xDEEE20FF, "The Door is opening");
  256. }
  257. else
  258. {
  259. SendClientMessage(playerid, 0xDEEE20FF, "you have to be an admin to do this");
  260. }
  261. return 1;
  262. }
  263.  
  264.  
  265.  
  266.  
  267. if (strcmp(cmdtext, "/closedoor", true) == 0)
  268. {
  269. if(IsPlayerAdmin(playerid) == 1)
  270. {
  271. MoveObject(door, 2494.498779, -1670.283569, 13.480176, 50);
  272. SendClientMessage(playerid, 0xDEEE20FF, "the door is closing.");
  273. }
  274. else
  275. {
  276. SendClientMessage(playerid, 0xDEEE20FF, "you have to be an admin to do this");
  277. }
  278. return 1;
  279. }
  280.  
  281. if (strcmp(cmdtext, "/credits", true) == 0)
  282. {
  283. SendClientMessage(playerid, 0xDEEE20FF, "Jail made by cale");
  284.  
  285. return 1;}
  286.  
  287. return 0;
  288. }
  289. strtok(const string[], &index)
  290. {
  291. new length = strlen(string);
  292. while ((index < length) && (string[index] <= ' '))
  293. {
  294. index++;
  295. }
  296.  
  297. new offset = index;
  298. new result[20];
  299. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  300. {
  301. result[index - offset] = string[index];
  302. index++;
  303. }
  304. result[index - offset] = EOS;
  305. return result;
  306. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement