Advertisement
Guest User

Graffity System v1.0 by PabuLetz.

a guest
Jul 15th, 2013
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 KB | None | 0 0
  1. // Graffity System
  2. // Credits :
  3. // PabuLetz. - Creator for FilterScripts
  4. // Acest Graffity System consta in creearea unor tatuaje pe pereti
  5. // Comenzi:
  6. // /cgraffity
  7. // /cremove
  8.  
  9.  
  10. #define FILTERSCRIPT
  11.  
  12. #include <a_samp>
  13. #define COLOR_RED 0xAA3333AA
  14. //#define COLOR_GRAF1 0xFF0000FF
  15. #define COLOR_GRAF2 0xFF8000FF
  16. #define COLOR_GRAF3 0x0000FFFF
  17. #define COLOR_GRAF4 0x00FF00FF
  18. #define MAX_GRAFFITI 50
  19.  
  20. #pragma tabsize 0
  21. new graffity;
  22. #define MAX_GRAFTEXT (64)
  23. new GrafText[MAX_PLAYERS][MAX_GRAFTEXT];
  24. new graf[MAX_PLAYERS];
  25.  
  26. #if defined FILTERSCRIPT
  27.  
  28. public OnFilterScriptInit()
  29. {
  30. print("\n--------------------------------------");
  31. print(" Graffity System");
  32. print("--------------------------------------\n");
  33. return 1;
  34. }
  35.  
  36. public OnFilterScriptExit()
  37. {
  38. return 1;
  39. }
  40.  
  41. #else
  42.  
  43. main()
  44. {
  45. print("\n----------------------------------");
  46. print(" GRaffity System");
  47. print("----------------------------------\n");
  48. }
  49.  
  50. #endif
  51.  
  52. public OnGameModeInit()
  53. {
  54. return 1;
  55. }
  56.  
  57. public OnGameModeExit()
  58. {
  59. return 1;
  60. }
  61.  
  62. public OnPlayerRequestClass(playerid, classid)
  63. {
  64. return 1;
  65. }
  66.  
  67. public OnPlayerConnect(playerid)
  68. {
  69. graf[playerid] = 0;
  70. return 1;
  71. }
  72. public OnPlayerDisconnect(playerid, reason)
  73. {
  74. graf[playerid] = 0;
  75. return 1;
  76. }
  77.  
  78. public OnPlayerSpawn(playerid)
  79. {
  80. return 1;
  81. }
  82.  
  83. public OnPlayerDeath(playerid, killerid, reason)
  84. {
  85. return 1;
  86. }
  87.  
  88. public OnVehicleSpawn(vehicleid)
  89. {
  90. return 1;
  91. }
  92.  
  93. public OnVehicleDeath(vehicleid, killerid)
  94. {
  95. return 1;
  96. }
  97.  
  98. public OnPlayerText(playerid, text[])
  99. {
  100. return 1;
  101. }
  102.  
  103. public OnPlayerCommandText(playerid, cmdtext[])
  104. {
  105.  
  106.  
  107. if (strcmp("/cgraffity", cmdtext, true, 10) == 0)
  108. {
  109. ShowPlayerDialog(playerid, 1998, DIALOG_STYLE_MSGBOX, "Graffity System", "Sigur vrei sa creezi un tatuaj?", "Ok", "");
  110. return 1;
  111. }
  112. if (strcmp("/cremove", cmdtext, true, 10) == 0)
  113. {
  114. DestroyObject(graffity);
  115. SendClientMessage(playerid,-1,"Ai sters tatuaju.");
  116. return 1;
  117. }
  118. return 0;
  119. }
  120. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  121. {
  122. if(dialogid == 1998)
  123. {
  124. if(response)
  125. {
  126. SendClientMessage(playerid,-1,"Aranjeaza cum vrei sa fie pozitionat tatuaju.");
  127. new Float:X, Float:Y, Float:Z, Float:A;
  128. GetPlayerFacingAngle(playerid, A);
  129. GetPlayerPos(playerid, X, Y, Z);
  130. graffity = CreateObject(19482,X,Y,Z+0.5,0.0,0.0,0.0,0.0);
  131. SetObjectMaterialText(graffity,"Tatuaj nou",0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,0xAA3333AA,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  132. EditObject(playerid,graffity);
  133. graf[playerid] = 1;
  134. }
  135. }
  136. if(dialogid == 1996)
  137. {
  138. if(response)
  139. {
  140. if(listitem == 0)
  141. {
  142. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-256,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  143. }
  144. if(listitem == 1)
  145. {
  146. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16468988,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  147. }
  148. if(listitem == 2)
  149. {
  150. SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Comic Sans MS",24,1,-16730675,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  151. }
  152. }
  153. }
  154. if(dialogid == 1997)
  155. {
  156. if(response)
  157. {
  158. if(!strlen(inputtext))
  159. {
  160. SendClientMessage(playerid,-1,"ERROR: Not write in the box text. !");
  161. ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
  162. return 1;
  163. }
  164. new Float:X, Float:Y, Float:Z, Float:A;
  165. GetPlayerFacingAngle(playerid, A);
  166. GetPlayerPos(playerid, X, Y, Z);
  167. SetObjectMaterialText(graffity, inputtext,0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,0xFFFFFFFF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  168. strcat(GrafText[playerid], inputtext, MAX_GRAFTEXT);
  169. ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Yellow\nGreen\nSky-Blue", "Select", "Close");
  170. graf[playerid] = 0;
  171. }
  172. }
  173. return 1;
  174. }
  175. public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
  176. {
  177. new Float:oldX, Float:oldY, Float:oldZ,
  178. Float:oldRotX, Float:oldRotY, Float:oldRotZ;
  179. GetObjectPos(graffity, oldX, oldY, oldZ);
  180. GetObjectRot(graffity, oldRotX, oldRotY, oldRotZ);
  181. if(!playerobject)
  182. {
  183. if(!IsValidObject(graffity)) return;
  184. MoveObject(graffity, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  185. }
  186. if(response == EDIT_RESPONSE_FINAL)
  187. {
  188. SendClientMessage(playerid,-1,"Acum foloseste acest spray pentru a finaliza tatuaju !");
  189. GivePlayerWeapon(playerid, 41, 5000);
  190.  
  191. }
  192. }
  193.  
  194. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  195. {
  196. if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) == 41)
  197. {
  198. if(graf[playerid] == 1)
  199. {
  200. SetTimerEx("Object", 5000, false, "i", playerid);
  201. }
  202. }
  203. return 1;
  204. }
  205.  
  206. forward Object(playerid);
  207.  
  208. public Object(playerid)
  209. {
  210. ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
  211. return 1;
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement