Advertisement
Guest User

VIP Color

a guest
Apr 20th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.47 KB | None | 0 0
  1. /*
  2. VIP Color by Джо
  3. Contine comenzile: /vipcolor
  4. Comanda a fost trecuta pe procesorul ZCMD.
  5. */
  6. #define FILTERSCRIPT
  7. #include <a_samp>
  8. #include <zcmd>
  9.  
  10. #define COLOR_FADE1 0xE6E6E6E6
  11. #define COLOR_FADE2 0xC8C8C8C8
  12. #define COLOR_FADE3 0xAAAAAAAA
  13. #define COLOR_FADE4 0x8C8C8C8C
  14. #define COLOR_FADE5 0x6E6E6E6E
  15.  
  16. #define SCM SendClientMessage
  17. new CULOARE[MAX_PLAYERS];
  18. enum {
  19.  
  20. DIALOG_VIPCOLOR
  21. };
  22.  
  23. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  24.  
  25. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  26. {
  27. if(IsPlayerConnected(playerid))
  28. {
  29. new Float:posx, Float:posy, Float:posz;
  30. new Float:oldposx, Float:oldposy, Float:oldposz;
  31. new Float:tempposx, Float:tempposy, Float:tempposz;
  32. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  33. //radi = 2.0; //Trigger Radius
  34. for(new i = 0; i < MAX_PLAYERS; i++)
  35. {
  36. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  37. {
  38. GetPlayerPos(i, posx, posy, posz);
  39. tempposx = (oldposx -posx);
  40. tempposy = (oldposy -posy);
  41. tempposz = (oldposz -posz);
  42. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  43. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  44. {
  45. SendClientMessage(i, col1, string);
  46. }
  47. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  48. {
  49. SendClientMessage(i, col2, string);
  50. }
  51. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  52. {
  53. SendClientMessage(i, col3, string);
  54. }
  55. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  56. {
  57. SendClientMessage(i, col4, string);
  58. }
  59. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  60. {
  61. SendClientMessage(i, col5, string);
  62. }
  63. }
  64. }
  65. }//not connected
  66. return 1;
  67. }
  68.  
  69. public OnFilterScriptInit()
  70. {
  71. print("\n--------------------------------------");
  72. print(" VIP Color by Joe Vitollo aka Джо");
  73. print("--------------------------------------\n");
  74. return 1;
  75. }
  76.  
  77. public OnFilterScriptExit()
  78. {
  79. return 1;
  80. }
  81.  
  82. public OnGameModeInit()
  83. {
  84. // Don't use these lines if it's a filterscript
  85. SetGameModeText("Blank Script");
  86. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  87. return 1;
  88. }
  89.  
  90. public OnGameModeExit()
  91. {
  92. return 1;
  93. }
  94.  
  95. public OnPlayerRequestClass(playerid, classid)
  96. {
  97. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  98. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  99. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  100. return 1;
  101. }
  102.  
  103. public OnPlayerConnect(playerid)
  104. {
  105. CULOARE[playerid] = 0;
  106. return 1;
  107. }
  108.  
  109. public OnPlayerDisconnect(playerid, reason)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnPlayerSpawn(playerid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnPlayerDeath(playerid, killerid, reason)
  120. {
  121. CULOARE[playerid] = 0;
  122. SCM(playerid, -1, "Ai murit.Acum ai culoarea ta default la scris.");
  123. return 1;
  124. }
  125.  
  126. public OnVehicleSpawn(vehicleid)
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnVehicleDeath(vehicleid, killerid)
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnPlayerText(playerid, text[])
  137. {
  138. new string[360], name[MAX_PLAYER_NAME];
  139. GetPlayerName(playerid, name, sizeof(name));
  140.  
  141. if(CULOARE[playerid] == 1)
  142. {
  143. format(string, sizeof(string), "{FFFFFF}%s spune: %s", name, text);
  144. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  145. }
  146. else if(CULOARE[playerid] == 2)
  147. {
  148. format(string, sizeof(string), "{00FF00}%s{FFFFFF} spune: %s", name, text);
  149. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  150. }
  151. else if(CULOARE[playerid] == 3)
  152. {
  153. format(string, sizeof(string), "{009933}%s{FFFFFF} spune: %s", name, text);
  154. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  155. }
  156. else if(CULOARE[playerid] == 4)
  157. {
  158. format(string, sizeof(string), "{FF0000}%s{FFFFFF} spune: %s", name, text);
  159. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  160. }
  161. else if(CULOARE[playerid] == 5)
  162. {
  163. format(string, sizeof(string), "{660033}%s{FFFFFF} spune: %s", name, text);
  164. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  165. }
  166. else if(CULOARE[playerid] == 6)
  167. {
  168. format(string, sizeof(string), "{CC00FF}%s{FFFFFF} spune: %s", name, text);
  169. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  170. }
  171. else if(CULOARE[playerid] == 7)
  172. {
  173. format(string, sizeof(string), "{00CCFF}%s{FFFFFF} spune: %s", name, text);
  174. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  175. }
  176. else if(CULOARE[playerid] == 8)
  177. {
  178. format(string, sizeof(string), "{3333FF}%s{FFFFFF} spune: %s", name, text);
  179. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  180. }
  181. else if(CULOARE[playerid] == 9)
  182. {
  183. format(string, sizeof(string), "{FFCC00}%s{FFFFFF} spune: %s", name, text);
  184. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  185. }
  186. else if(CULOARE[playerid] == 10)
  187. {
  188. format(string, sizeof(string), "{FF9900}%s{FFFFFF} spune: %s", name, text);
  189. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  190. }
  191. else if(CULOARE[playerid] == 11)
  192. {
  193. format(string, sizeof(string), "{FFFF00}%s{FFFFFF} spune: %s", name, text);
  194. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  195. }
  196. else if(CULOARE[playerid] == 12)
  197. {
  198. format(string, sizeof(string), "{FFFF33}%s{FFFFFF} spune: %s", name, text);
  199. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  200. }
  201. else if(CULOARE[playerid] == 13)
  202. {
  203. format(string, sizeof(string), "{FF00CC}%s{FFFFFF} spune: %s", name, text);
  204. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  205. }
  206. else if(CULOARE[playerid] == 14)
  207. {
  208. format(string, sizeof(string), "{99FF00}%s{FFFFFF} spune: %s", name, text);
  209. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  210. }
  211. else if(CULOARE[playerid] == 15)
  212. {
  213. format(string, sizeof(string), "{990099}%s{FFFFFF} spune: %s", name, text);
  214. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  215. }
  216. else if(CULOARE[playerid] == 16)
  217. {
  218. format(string, sizeof(string), "{99FF00}%s{FFFFFF} spune: %s", name, text);
  219. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  220. }
  221. else if(CULOARE[playerid] == 17)
  222. {
  223. format(string, sizeof(string), "{FFFF66}%s{FFFFFF} spune: %s", name, text);
  224. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  225. }
  226. else if(CULOARE[playerid] == 18)
  227. {
  228. format(string, sizeof(string), "{66FFFF}%s{FFFFFF} spune: %s", name, text);
  229. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  230. }
  231. return 1;
  232. }
  233.  
  234. CMD:vipcolor(playerid, params[])
  235. {
  236. ShowPlayerDialog(playerid, DIALOG_VIPCOLOR, DIALOG_STYLE_LIST, "VIP COLOR", "{FFFFFF}White\n{00FF00}Lime Green\n{009933}Green\n{FF0000}Red\n{660033}Unsual Red\n{CC00FF}Purple\n{00CCFF}Blue\n{3333FF}Dark Blue\n{FFCC00}Orange\n{FF9900}Deep Orange\n{FFFF00}Gold\n{FFFF33}Yellow\n{FF00CC}Pink\n{99FF00}Unsual Green\n{990099}Violet\n{99FF66}Unsual Green 2\n{FFFF66}Deep Yellow\n{66FFFF}Aqua Blue", "Select", "Cancel");
  237. return 1;
  238. }
  239. CMD:qcolor(playerid, params[])
  240. {
  241. CULOARE[playerid] = 0;
  242. SCM(playerid, -1, "Comanda executata cu succes.");
  243. return 1;
  244. }
  245.  
  246. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  247. {
  248. if(dialogid == DIALOG_VIPCOLOR)
  249. {
  250. if(response)
  251. {
  252. switch(listitem)
  253. {
  254. case 0:
  255. {
  256. CULOARE[playerid] = 1;
  257. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  258.  
  259. }
  260. case 1:
  261. {
  262. CULOARE[playerid] = 2;
  263. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  264. }
  265. case 2:
  266. {
  267. CULOARE[playerid] = 3;
  268. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  269. }
  270. case 3:
  271. {
  272. CULOARE[playerid] = 4;
  273. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  274.  
  275. }
  276. case 4:
  277. {
  278. CULOARE[playerid] = 5;
  279. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  280. }
  281. case 5:
  282. {
  283. CULOARE[playerid] = 6;
  284. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  285. }
  286. case 6:
  287. {
  288. CULOARE[playerid] = 7;
  289. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  290.  
  291. }
  292. case 7:
  293. {
  294. CULOARE[playerid] = 8;
  295. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  296. }
  297. case 8:
  298. {
  299. CULOARE[playerid] = 9;
  300. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  301. }
  302. case 9:
  303. {
  304. CULOARE[playerid] = 10;
  305. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  306.  
  307. }
  308. case 10:
  309. {
  310. CULOARE[playerid] = 11;
  311. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  312. }
  313. case 11:
  314. {
  315. CULOARE[playerid] = 12;
  316. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  317. }
  318. case 12:
  319. {
  320. CULOARE[playerid] = 13;
  321. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  322.  
  323. }
  324. case 13:
  325. {
  326. CULOARE[playerid] = 14;
  327. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  328. }
  329. case 14:
  330. {
  331. CULOARE[playerid] = 15;
  332. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  333. }
  334. case 15:
  335. {
  336. CULOARE[playerid] = 16;
  337. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  338.  
  339. }
  340. case 16:
  341. {
  342. CULOARE[playerid] = 17;
  343. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  344. }
  345. case 17:
  346. {
  347. CULOARE[playerid] = 18;
  348. SCM(playerid,-1,"Culoarea a fost aplicata cu succes.");
  349. }
  350. }
  351. }
  352. return 1;
  353. }
  354. return 1;
  355. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement