Advertisement
Guest User

Sisitema de Pix

a guest
Sep 9th, 2011
1,030
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.82 KB | None | 0 0
  1. #include <a_samp>
  2. //**COLORS*//
  3. #define GREEN 0x21DD00FF
  4. #define RED 0xE60000FF
  5. #define ADMIN_RED 0xFB0000FF
  6. #define YELLOW 0xFFFF00FF
  7. #define ORANGE 0xF97804FF
  8. #define LIGHTRED 0xFF8080FF
  9. #define LIGHTBLUE 0x00C2ECFF
  10. #define PURPLE 0xB360FDFF
  11. #define PLAYER_COLOR 0xFFFFFFFF
  12. #define BLUE 0x1229FAFF
  13. #define LIGHTGREEN 0x38FF06FF
  14. #define DARKPINK 0xE100E1FF
  15. #define COLOR_DBLUE 0x2641FEAA
  16. #define DARKGREEN 0x008040FF
  17. #define ANNOUNCEMENT 0x6AF7E1FF
  18. #define COLOR_SYSTEM 0xEFEFF7AA
  19. #define GRAY 0xCECECEFF
  20.  
  21. #define MAX_TAGS 200
  22.  
  23. #define BALLAS_TAG 1529
  24. #define GROVE_TAG 1528
  25. #define VAGOS_TAG 1530
  26. #define AZTEC_TAG 1531
  27. #define GMOB_TAG 1526
  28.  
  29. enum tagInfo
  30. {
  31. tgSprayer[24],
  32. Float:tgX,
  33. Float:tgY,
  34. Float:tgZ,
  35. };
  36.  
  37. enum pInfo
  38. {
  39. pKey[128],
  40. pLevel,
  41. pAdmin,
  42. pSocio,
  43. pVIP,
  44. gPupgrade,
  45. pConnectTime,
  46. pReg,
  47. pSex,
  48. pFamily,
  49. pAge,
  50. pOrigem,
  51. pCK,
  52. pMuted,
  53. pExp,
  54. pCash,
  55. pConta,
  56. pCrimes,
  57. pKills,
  58. pDeaths,
  59. pArrested,
  60. pWantedDeaths,
  61. pPhoneBook,
  62. pLottoNr,
  63. pFishes,
  64. pBiggestFish,
  65. pEmprego,
  66. pPayCheck,
  67. pHeadValue,
  68. pJailed,
  69. pJailTime,
  70. pMats,
  71. pDrogas,
  72. pDrogas2,
  73. pDrogas3,
  74. pLider,
  75. pMembro,
  76. pFMember,
  77. pCargo,
  78. pChar,
  79. pContractTime,
  80. pDetSkill,
  81. pSexSkill,
  82. pBoxSkill,
  83. pLawSkill,
  84. pMechSkill,
  85. pJackSkill,
  86. pCarSkill,
  87. pNewsSkill,
  88. pDrogasSkill,
  89. pBalinhaSkill,
  90. pCookSkill,
  91. pFishSkill,
  92. Float:pHealth,
  93. Float:pSHealth,
  94. pInt,
  95. pLocal,
  96. pTeam,
  97. pModel,
  98. pPnumber,
  99. pPHousekey,
  100. pPbiskey,
  101. Float:pPos_x,
  102. Float:pPos_y,
  103. Float:pPos_z,
  104. pCarLic,
  105. pFlyLic,
  106. pBoatLic,
  107. pFishLic,
  108. pGunLic,
  109. pGun1,
  110. pGun2,
  111. pGun3,
  112. pGun4,
  113. pAmmo1,
  114. pAmmo2,
  115. pAmmo3,
  116. pAmmo4,
  117. pCarTime,
  118. pPayDay,
  119. pPayDayHad,
  120. pCDPlayer,
  121. pWins,
  122. pLoses,
  123. pAlcoholPerk,
  124. pDrugPerk,
  125. pMiserPerk,
  126. pPainPerk,
  127. pTraderPerk,
  128. pTut,
  129. pMissionNr,
  130. pWarns,
  131. pAdjustable,
  132. pFuel,
  133. pMarried,
  134. pBalinha,
  135. pAPaisanaCIA,
  136. pRoadblock,
  137. pRequestingBackup,
  138. pMask,
  139. pMaskuse,
  140. pBarraca,
  141. pMarriedTo[128],
  142. pSpawn,
  143. pBan,
  144. pSafeDrogas,
  145. pSafeDrogas2,
  146. pSafeDrogas3,
  147. pVeiculo,
  148. pCarKey,
  149. psMats,
  150. VipVaga,
  151. adminID,
  152. vipID,
  153. pPHouseCarkey,
  154. pRoadPregos,
  155. };
  156. new PlayerInfo[MAX_PLAYERS][pInfo];
  157.  
  158. new Spray[MAX_TAGS],Tag,Sprayed[MAX_PLAYERS];
  159. new TagInfo[MAX_TAGS][tagInfo];
  160.  
  161. forward OnPlayerSpray(playerid);
  162.  
  163. public OnFilterScriptInit() // > OnGameModeInit
  164. {
  165. Tag = 0;
  166. return 1;
  167. }
  168.  
  169. public OnPlayerConnect(playerid)
  170. {
  171. Sprayed[playerid] = 0;
  172. return 1;
  173. }
  174.  
  175. public OnPlayerCommandText(playerid, cmdtext[])
  176. {
  177.  
  178. if(strcmp(cmdtext, "/rpit", true)==0)
  179. {
  180. if (Tag == 0) return SendClientMessage(playerid,RED,"Pichações não encontradas");
  181. SendClientMessageToAll(COLOR_DBLUE, "[BSF] Todas as pichações foram removidas pelo administrador.");
  182. if (!PlayerInfo[playerid][pAdmin] >= 4) return SendClientMessage(playerid,RED,"Voce nao é um admin");
  183. for(new stags = 1; stags <= 200; stags++)
  184. {
  185. DestroyObject(Spray[stags]);
  186. Tag = 0;
  187. }
  188. return 1;
  189. }
  190. if(strcmp(cmdtext, "/rpi", true)==0)
  191. {
  192. new count;
  193. new frm[128];
  194. for(new i = 0; i < MAX_TAGS; i++)
  195. {
  196. if(PlayerToPoint(playerid,2,TagInfo[i][tgX],TagInfo[i][tgY],TagInfo[i][tgZ]))
  197. {
  198. GetPlayerName(playerid, frm, MAX_PLAYER_NAME);
  199. if (!strcmp(TagInfo[i][tgSprayer],frm))
  200. {
  201. DestroyObject(Spray[i]);
  202. TagInfo[i][tgX] = 0;
  203. TagInfo[i][tgY] = 0;
  204. TagInfo[i][tgZ] = 0;
  205. Spray[i] = INVALID_OBJECT_ID;
  206. strmid(TagInfo[i][tgSprayer], " ", 0, 1);
  207. Tag--;
  208. count++;
  209. }
  210. }
  211. }
  212. format(frm, sizeof(frm), " Voce removeu as pichações de %d", count);
  213. SendClientMessage(playerid, GRAY, frm);
  214. return 1;
  215. }
  216. if(strcmp(cmdtext, "/pdelet2", true)==0)
  217. {
  218. if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, " You're not an admin");
  219. new count;
  220. new frm[128];
  221. for(new i = 0; i < MAX_TAGS; i++)
  222. {
  223. if(PlayerToPoint(playerid,2,TagInfo[i][tgX],TagInfo[i][tgY],TagInfo[i][tgZ]))
  224. {
  225. DestroyObject(Spray[i]);
  226. TagInfo[i][tgX] = 0;
  227. TagInfo[i][tgY] = 0;
  228. TagInfo[i][tgZ] = 0;
  229. Spray[i] = INVALID_OBJECT_ID;
  230. strmid(TagInfo[i][tgSprayer], " ", 0, 1);
  231. Tag--;
  232. count++;
  233. }
  234. }
  235. format(frm, sizeof(frm), " You have deleted %d tags", count);
  236. SendClientMessage(playerid, GRAY, frm);
  237. return 1;
  238. }
  239. if(strcmp(cmdtext, "/autor", true)==0)
  240. {
  241. if (Tag == 0) return SendClientMessage(playerid,RED,"Nenhuma pichação por perto");
  242. new string[128];
  243. for(new stags = 0; stags < MAX_TAGS; stags++)
  244. {
  245. if (PlayerToPoint(playerid,2,TagInfo[stags][tgX],TagInfo[stags][tgY],TagInfo[stags][tgZ]))
  246. {
  247. printf("%d - %d",Tag,stags);
  248. format(string,sizeof(string),"Pichador: %s - pichação #%d",TagInfo[stags][tgSprayer],stags);
  249. SendClientMessage(playerid,GRAY,string);
  250. }
  251. }
  252. return 1;
  253. }
  254. return 0;
  255. }
  256.  
  257. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  258. {
  259. if (newkeys == KEY_FIRE && GetPlayerWeapon(playerid) == 41)
  260. {
  261. SetTimerEx("OnPlayerSpray",2000,0,"d",playerid);
  262. }
  263. return 1;
  264. }
  265.  
  266. public OnPlayerSpray(playerid)
  267. {
  268. new keys,updown,leftright;
  269. GetPlayerKeys(playerid,keys,updown,leftright);
  270. if (keys == KEY_FIRE)
  271. {
  272. if (GetPlayerSkin(playerid) >= 102 && GetPlayerSkin(playerid) <= 104) // Ballas
  273. {
  274. for(new stags = Tag; stags < MAX_TAGS; stags++)
  275. {
  276. if (Tag >= MAX_TAGS-1) return SendClientMessage(playerid,RED,"Voce nao pode pichar por aqui, essa area ja esta cheia.");
  277. new Float:X, Float:Y, Float:Z,Float:A,name[24];
  278. GetPlayerPos(playerid, X, Y, Z);
  279. GetPlayerFacingAngle(playerid, A);
  280. GetPlayerName(playerid,name,24);
  281. X += (1 * floatsin(-A, degrees));
  282. Y += (1 * floatcos(-A, degrees));
  283. TagInfo[stags][tgX] = X;
  284. TagInfo[stags][tgY] = Y;
  285. TagInfo[stags][tgZ] = Z;
  286. Sprayed[playerid] = 1;
  287. Tag += 1;
  288. Spray[stags] = CreateObject(BALLAS_TAG, X, Y, Z, 0.0, 0.0, A+90);
  289. GameTextForPlayer(playerid,"~r~~h~Pichacao completa!",3000,3);
  290. PlayerPlaySound(playerid,1057,0,0,0);
  291. strmid(TagInfo[stags][tgSprayer], name, 0, strlen(name),128);
  292. printf("[PICHAÇÃO] %s - %d",TagInfo[stags][tgSprayer],stags);
  293. break;
  294. }
  295. }
  296. if (GetPlayerSkin(playerid) >= 114 && GetPlayerSkin(playerid) <= 116) // aztecas
  297. {
  298. for(new stags = Tag; stags < MAX_TAGS; stags++)
  299. {
  300. if (Tag >= MAX_TAGS-1) return SendClientMessage(playerid,RED,"Voce nao pode pichar por aqui, essa area ja esta cheia.");
  301. new Float:X, Float:Y, Float:Z,Float:A,name[24];
  302. GetPlayerPos(playerid, X, Y, Z);
  303. GetPlayerFacingAngle(playerid, A);
  304. GetPlayerName(playerid,name,24);
  305. X += (1 * floatsin(-A, degrees));
  306. Y += (1 * floatcos(-A, degrees));
  307. TagInfo[stags][tgX] = X;
  308. TagInfo[stags][tgY] = Y;
  309. TagInfo[stags][tgZ] = Z;
  310. Sprayed[playerid] = 1;
  311. Tag += 1;
  312. Spray[stags] = CreateObject(AZTEC_TAG, X, Y, Z, 0.0, 0.0, A+90);
  313. GameTextForPlayer(playerid,"~r~~h~Pichacao completa!",3000,3);
  314. PlayerPlaySound(playerid,1057,0,0,0);
  315. strmid(TagInfo[stags][tgSprayer], name, 0, strlen(name),128);
  316. printf("[PICHAÇÃO] %s - %d",TagInfo[stags][tgSprayer],stags);
  317. break;
  318. }
  319. }
  320. if (GetPlayerSkin(playerid) >= 108 && GetPlayerSkin(playerid) <= 110) // vagos
  321. {
  322. for(new stags = Tag; stags < MAX_TAGS; stags++)
  323. {
  324. if (Tag >= MAX_TAGS-1) return SendClientMessage(playerid,RED,"Voce nao pode pichar por aqui, essa area ja esta cheia.");
  325. new Float:X, Float:Y, Float:Z,Float:A,name[24];
  326. GetPlayerPos(playerid, X, Y, Z);
  327. GetPlayerFacingAngle(playerid, A);
  328. GetPlayerName(playerid,name,24);
  329. X += (1 * floatsin(-A, degrees));
  330. Y += (1 * floatcos(-A, degrees));
  331. TagInfo[stags][tgX] = X;
  332. TagInfo[stags][tgY] = Y;
  333. TagInfo[stags][tgZ] = Z;
  334. Sprayed[playerid] = 1;
  335. Tag += 1;
  336. Spray[stags] = CreateObject(VAGOS_TAG, X, Y, Z, 0.0, 0.0, A+90);
  337. GameTextForPlayer(playerid,"~r~~h~Pichacao completa!",3000,3);
  338. PlayerPlaySound(playerid,1057,0,0,0);
  339. strmid(TagInfo[stags][tgSprayer], name, 0, strlen(name),128);
  340. printf("[PICHAÇÃO] %s - %d",TagInfo[stags][tgSprayer],stags);
  341. break;
  342. }
  343. }
  344. if (GetPlayerSkin(playerid) >=132 && GetPlayerSkin(playerid) <= 236) // gmob
  345. {
  346. for(new stags = Tag; stags < MAX_TAGS; stags++)
  347. {
  348. if (Tag >= MAX_TAGS-1) return SendClientMessage(playerid,RED,"Está area ta cheia de pixação.");
  349. new Float:X, Float:Y, Float:Z,Float:A,name[24];
  350. GetPlayerPos(playerid, X, Y, Z);
  351. GetPlayerFacingAngle(playerid, A);
  352. GetPlayerName(playerid,name,24);
  353. X += (1 * floatsin(-A, degrees));
  354. Y += (1 * floatcos(-A, degrees));
  355. TagInfo[stags][tgX] = X;
  356. TagInfo[stags][tgY] = Y;
  357. TagInfo[stags][tgZ] = Z;
  358. Sprayed[playerid] = 1;
  359. Tag += 1;
  360. Spray[stags] = CreateObject(GMOB_TAG, X, Y, Z, 0.0, 0.0, A+90);
  361. GameTextForPlayer(playerid,"~r~~h~Pichacao completa!",3000,3);
  362. PlayerPlaySound(playerid,1057,0,0,0);
  363. strmid(TagInfo[stags][tgSprayer], name, 0, strlen(name),128);
  364. printf("[PICHAÇÃO] %s - %d",TagInfo[stags][tgSprayer],stags);
  365. break;
  366. }
  367. }
  368. if (GetPlayerSkin(playerid) >= 105 && GetPlayerSkin(playerid) <= 107) // Grove
  369. {
  370. for(new stags = Tag; stags < MAX_TAGS; stags++)
  371. {
  372. if (Tag >= MAX_TAGS-1) return SendClientMessage(playerid,RED,"Voce nao pode pichar por aqui, essa area ja esta cheia.");
  373. new Float:X, Float:Y, Float:Z,Float:A,name[24];
  374. GetPlayerPos(playerid, X, Y, Z);
  375. GetPlayerFacingAngle(playerid, A);
  376. GetPlayerName(playerid,name,24);
  377. X += (1 * floatsin(-A, degrees));
  378. Y += (1 * floatcos(-A, degrees));
  379. TagInfo[stags][tgX] = X;
  380. TagInfo[stags][tgY] = Y;
  381. TagInfo[stags][tgZ] = Z;
  382. Sprayed[playerid] = 1;
  383. Tag += 1;
  384. Spray[stags] = CreateObject(GROVE_TAG, X, Y, Z, 0.0, 0.0, A+90);
  385. GameTextForPlayer(playerid,"~b~~h~Pichacao completa!",3000,3);
  386. PlayerPlaySound(playerid,1057,0,0,0);
  387. strmid(TagInfo[stags][tgSprayer], name, 0, strlen(name),128);
  388. printf("[PICHAÇÃO] %s - %d",TagInfo[stags][tgSprayer],stags);
  389. break;
  390. }
  391. }
  392. }
  393. return 1;
  394. }
  395.  
  396. stock PlayerToPoint(playerid,Float:radi, Float:px, Float:py, Float:pz)
  397. {
  398. if(IsPlayerConnected(playerid))
  399. {
  400. new Float:x, Float:y, Float:z;
  401. new Float:ox, Float:oy, Float:oz;
  402. GetPlayerPos(playerid, ox, oy, oz);
  403. x = (ox -px);
  404. y = (oy -py);
  405. z = (oz -pz);
  406. if (((x < radi) && (x > -radi)) && ((y < radi) && (y > -radi)) && ((z < radi) && (z > -radi))) return 1;
  407. }
  408. return 0;
  409. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement