Advertisement
Guest User

Spray tags - CLBSAMP.TK

a guest
Nov 21st, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.04 KB | None | 0 0
  1. // Graffity System
  2. // Credits :
  3. // PabuLetz. - Creator for FilterScripts
  4. // Gireada - Rezolve an error
  5. // Acest Graffity System consta in creearea unor tatuaje pe pereti
  6. // Comenzi:
  7. // /cgraffity
  8. // /cremove
  9. // /graffity
  10.  
  11.  
  12. #define FILTERSCRIPT
  13.  
  14. #include <a_samp>
  15. #include <dini>
  16. #define COLOR_RED 0xAA3333AA
  17. //#define COLOR_GRAF1 0xFF0000FF
  18. #define COLOR_GRAF2 0xFF8000FF
  19. #define COLOR_GRAF3 0x0000FFFF
  20. #define COLOR_GRAF4 0x00FF00FF
  21. #define MAX_GRAFFITI 50
  22. #define Saver "Graffity/%s.ini"
  23. new GraffityDone[MAX_PLAYERS];
  24.  
  25. #pragma tabsize 0
  26. new graffity;
  27. #define MAX_GRAFTEXT (64)
  28. new GrafText1[MAX_PLAYERS][MAX_GRAFTEXT];
  29. new GrafText2[MAX_PLAYERS][MAX_GRAFTEXT];
  30. new GrafText[MAX_PLAYERS][MAX_GRAFTEXT];
  31. new GrafFont[MAX_PLAYERS];
  32. new GrafFont1[MAX_PLAYERS];
  33. new GrafFont2[MAX_PLAYERS];
  34. new GrafFont3[MAX_PLAYERS];
  35. new graf[MAX_PLAYERS];
  36. new text [ 50 ];
  37.  
  38. #if defined FILTERSCRIPT
  39.  
  40. public OnFilterScriptInit()
  41. {
  42. print("\n--------------------------------------");
  43. print(" Graffity System");
  44. print("--------------------------------------\n");
  45. return 1;
  46. }
  47.  
  48. public OnFilterScriptExit()
  49. {
  50. return 1;
  51. }
  52.  
  53. #else
  54.  
  55. main()
  56. {
  57. print("\n----------------------------------");
  58. print(" GRaffity System");
  59. print("----------------------------------\n");
  60. }
  61.  
  62. #endif
  63.  
  64. public OnGameModeInit()
  65. {
  66.  
  67. return 1;
  68. }
  69.  
  70. public OnGameModeExit()
  71. {
  72. return 1;
  73. }
  74.  
  75. public OnPlayerRequestClass(playerid, classid)
  76. {
  77. return 1;
  78. }
  79.  
  80. public OnPlayerConnect(playerid)
  81. {
  82. new file[100],Name[30];
  83. GetPlayerName(playerid,Name,30);
  84. format(file,100,Saver,Name);
  85. if(!dini_Exists(file))
  86. {
  87. dini_Create(file);
  88. dini_IntSet(file,"Graffity Created",GraffityDone[playerid] = 0);
  89. }
  90. else
  91. {
  92. GraffityDone[playerid] = dini_Int(file,"Graffity Created");
  93. }
  94. graf[playerid] = 0;
  95. return 1;
  96. }
  97. public OnPlayerDisconnect(playerid, reason)
  98. {
  99. new file[100],Name[30];
  100. GetPlayerName(playerid,Name,30);
  101. format(file,100,Saver,Name);
  102. dini_IntSet(file,"Graffity Created",GraffityDone[playerid]);
  103. graf[playerid] = 0;
  104. return 1;
  105. }
  106.  
  107. public OnPlayerSpawn(playerid)
  108. {
  109. return 1;
  110. }
  111.  
  112. public OnPlayerDeath(playerid, killerid, reason)
  113. {
  114. return 1;
  115. }
  116.  
  117. public OnVehicleSpawn(vehicleid)
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnVehicleDeath(vehicleid, killerid)
  123. {
  124. return 1;
  125. }
  126. public OnPlayerCommandText(playerid, cmdtext[])
  127. {
  128.  
  129.  
  130. if (strcmp("/spray", cmdtext, true, 10) == 0)
  131. {
  132. ShowPlayerDialog(playerid, 1998, DIALOG_STYLE_MSGBOX, "Graffity System", "Sigur vrei sa creezi un tatuaj?", "Da", "Nu");
  133. return 1;
  134. }
  135. if (strcmp("/spraymove", cmdtext, true, 10) == 0)
  136. {
  137. DestroyObject(graffity);
  138. SendClientMessage(playerid,-1,"Ai sters tatuaju.");
  139. return 1;
  140. }
  141. if(strcmp("/spraysystem", cmdtext, true, 10) == 0)
  142. {
  143. format(text, 50, "{30a030}[Graffity] {FFFFFF}Tu ai facut pana acuma {30a030}[ %d ] {FFFFFF}tatuaje", GraffityDone[playerid]);
  144. SendClientMessage(playerid, -1, text);
  145. return 1;
  146. }
  147. return 0;
  148. }
  149. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  150. {
  151. if(dialogid == 1998)
  152. {
  153. if(response)
  154. {
  155. SendClientMessage(playerid,-1,"Aranjeaza cum vrei sa fie pozitionat tatuaju.");
  156. new Float:X, Float:Y, Float:Z, Float:A;
  157. GetPlayerFacingAngle(playerid, A);
  158. GetPlayerPos(playerid, X, Y, Z);
  159. graffity = CreateObject(19482,X,Y,Z+0.5,0.0,0.0,0.0,0.0);
  160. SetObjectMaterialText(graffity,"Tatuaj nou",0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,0xAA3333AA,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  161. EditObject(playerid,graffity);
  162. graf[playerid] = 1;
  163. GraffityDone[playerid]++;
  164. }
  165. }
  166. if(dialogid == 1996)
  167. {
  168. if(response)
  169. {
  170. if(listitem == 0)
  171. {
  172. if(GrafFont[playerid] == 1)
  173. {
  174. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  175. }
  176. if(GrafFont1[playerid] == 1)
  177. {
  178. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  179. }
  180. if(GrafFont2[playerid] == 1)
  181. {
  182. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  183. }
  184. if(GrafFont3[playerid] == 1)
  185. {
  186. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Courier",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  187. }
  188. }
  189. if(listitem == 1)
  190. {
  191. if(GrafFont[playerid] == 1)
  192. {
  193. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  194. }
  195. if(GrafFont1[playerid] == 1)
  196. {
  197. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  198. }
  199. if(GrafFont2[playerid] == 1)
  200. {
  201. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  202. }
  203. if(GrafFont3[playerid] == 1)
  204. {
  205. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Courier",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  206. }
  207. }
  208. if(listitem == 2)
  209. {
  210. if(GrafFont[playerid] == 1)
  211. {
  212. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  213. }
  214. if(GrafFont1[playerid] == 1)
  215. {
  216. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  217. }
  218. if(GrafFont2[playerid] == 1)
  219. {
  220. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  221. }
  222. if(GrafFont3[playerid] == 1)
  223. {
  224. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Courier",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  225. }
  226. }
  227. }
  228. }
  229. if(dialogid == 1995)
  230. {
  231. if(response)
  232. {
  233. if(listitem == 0)
  234. {
  235. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  236. ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Chon", "Dong");
  237. GrafFont[playerid] = 1;
  238. }
  239. if(listitem == 1)
  240. {
  241. SetObjectMaterialText(graffity, GrafText1[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  242. ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Select", "Close");
  243. GrafFont1[playerid] = 1;
  244. }
  245. if(listitem == 2)
  246. {
  247. SetObjectMaterialText(graffity, GrafText2[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  248. ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Select", "Close");
  249. GrafFont2[playerid] = 1;
  250. }
  251. if(listitem == 3)
  252. {
  253. SetObjectMaterialText(graffity, GrafText2[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Courier",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  254. ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Select", "Close");
  255. GrafFont3[playerid] = 1;
  256. }
  257. }
  258. }
  259. if(dialogid == 1997)
  260. {
  261. if(response)
  262. {
  263. if(!strlen(inputtext))
  264. {
  265. SendClientMessage(playerid,-1,"ERROR: Not write in the box text. !");
  266. ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
  267. return 1;
  268. }
  269. new Float:X, Float:Y, Float:Z, Float:A;
  270. GetPlayerFacingAngle(playerid, A);
  271. GetPlayerPos(playerid, X, Y, Z);
  272. SetObjectMaterialText(graffity, inputtext,0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,0xAA3333AA,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  273. format(GrafText[playerid], MAX_GRAFTEXT, inputtext);
  274. format(GrafText1[playerid], MAX_GRAFTEXT, inputtext);
  275. format(GrafText2[playerid], MAX_GRAFTEXT, inputtext);
  276. //strcat(GrafText[playerid], inputtext, MAX_GRAFTEXT);
  277. //strcat(GrafText1[playerid], inputtext, MAX_GRAFTEXT);
  278. //strcat(GrafText2[playerid], inputtext, MAX_GRAFTEXT);
  279. ShowPlayerDialog(playerid, 1995, DIALOG_STYLE_LIST, "Font Graffity", "Arial\nComic Sans MS\nItalic\nCourier", "Select", "Close");
  280. graf[playerid] = 0;
  281. }
  282. }
  283. return 1;
  284. }
  285.  
  286. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  287. {
  288. new Float:oldX, Float:oldY, Float:oldZ,
  289. Float:oldRotX, Float:oldRotY, Float:oldRotZ;
  290. GetObjectPos(graffity, oldX, oldY, oldZ);
  291. GetObjectRot(graffity, oldRotX, oldRotY, oldRotZ);
  292. if(!playerobject)
  293. {
  294. if(!IsValidObject(graffity)) return;
  295. MoveObject(graffity, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  296. }
  297. if(response == EDIT_RESPONSE_FINAL)
  298. {
  299. SendClientMessage(playerid,-1,"Acum foloseste acest spray pentru a finaliza tatuaju !");
  300. GivePlayerWeapon(playerid, 41, 5000);
  301.  
  302. }
  303. }
  304.  
  305. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  306. {
  307. if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) == 41)
  308. {
  309. if(graf[playerid] == 1)
  310. {
  311. SetTimerEx("Object", 5000, false, "i", playerid);
  312. }
  313. }
  314. return 1;
  315. }
  316.  
  317. forward Object(playerid);
  318.  
  319. public Object(playerid)
  320. {
  321. ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
  322. return 1;
  323. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement