Guest User

By:eu, http://forum.sa-mp.com/

a guest
Jun 29th, 2016
1,169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.56 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <streamer>
  4. #include <ZCMD>
  5. #include <foreach>
  6.  
  7. //Skype: yZeCachuleta
  8. //=============================================================
  9. //DEFINES
  10. //=============================================================
  11. #define SCM SendClientMessage
  12. #define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  13.  
  14. //COLORS
  15. #define RED "{FFFFFF}»"
  16. #define VER "{F81414}"
  17. #define GREEN "{37DB45}"
  18. #define WHITE 0xFFFFFF00
  19.  
  20.  
  21. //=============================================================
  22. //ENUM
  23. //=============================================================
  24.  
  25. enum playerinfo
  26. {
  27.  
  28. pClan,
  29. pLeader
  30. };
  31. new pInfo[MAX_PLAYERS][playerinfo];
  32. //========================================================================//
  33. //NEWS
  34. //========================================================================//
  35. new gate5;
  36. new bool:clan5stats=false;
  37. //========================================================================//
  38. //========================================================================//
  39. //========================================================================//
  40. main()
  41. {
  42. print("\n----------------------------------");
  43. print(" SISTEM BY JEFFERSON // MrOvelha");
  44. print(" SISTEM BY JEFFERSON // MrOvelha");
  45. print(" SISTEM BY JEFFERSON // MrOvelha");
  46. print(" SISTEM BY JEFFERSON // MrOvelha");
  47. print(" SISTEM BY JEFFERSON // MrOvelha");
  48. print(" SISTEM BY JEFFERSON // MrOvelha");
  49. print(" SISTEM BY JEFFERSON // MrOvelha");
  50. print(" SISTEM BY JEFFERSON // MrOvelha");
  51. print("----------------------------------\n");
  52. }
  53.  
  54. public OnGameModeInit()
  55. {
  56. SetWorldTime(14);
  57. Gates();
  58. Create3DTextLabel("Created By:\n{C3C3C3}Jefferson/ MrOvelha", 0x008080FF, 134.4645,-106.1480,1.4297, 20, 0, 0);
  59. return 1;
  60. }
  61.  
  62. public OnGameModeExit()
  63. {
  64. return 1;
  65. }
  66.  
  67. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  68. {
  69. if(PRESSED(KEY_CROUCH) && IsPlayerInAnyVehicle(playerid))
  70. {
  71.  
  72. if(IsPlayerInRangeOfPoint(playerid, 7.0, -3.3517,-266.6953,5.4297))
  73. {
  74. if(pInfo[playerid][pClan] == 5)
  75. {
  76. if(clan5stats == false)
  77. {
  78. clan5stats = true;
  79. MoveObject(gate5, -3.2000000,-268.6000100,-1.0000000,1.5);
  80. SCM(playerid, -1, "* {37DB45}The gate was opened");
  81. }else{
  82. clan5stats = false;
  83. SCM(playerid, -1, "* {37DB45}The gate was closed ");
  84. MoveObject(gate5, -3.2000000,-268.6000100,7.2000000,1.5);
  85. }
  86. }
  87. }
  88. }
  89. return 1;
  90. }
  91.  
  92. public OnPlayerSpawn(playerid)
  93. {
  94. SetPlayerPos(playerid, 134.4645,-106.1480,1.4297);
  95. return 1;
  96. }
  97.  
  98. //=========================================================================//
  99. //CAR TEST
  100. CMD:cv(playerid, params[])
  101. {
  102. new idveiculo, Float:Pos[3];
  103. if(sscanf(params, "d", idveiculo)) return SendClientMessage(playerid, -1, "{FF0000}ERRO: use /cv [id veiculo]");
  104. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  105. CreateVehicle(idveiculo, Pos[0], Pos[1], Pos[2], 1515, 0, 6, 99999);
  106. GameTextForPlayer(playerid, "Veiculo Criado", 3000, 3);
  107. return 1;
  108. }
  109.  
  110. //========================================================================//
  111. CMD:armas(playerid, params[])
  112. {
  113. GivePlayerWeapon(playerid,24,100);
  114. GivePlayerWeapon(playerid,28,100);
  115. GivePlayerWeapon(playerid,30,100);
  116. GivePlayerWeapon(playerid,29,100);
  117. return 1;
  118. }
  119. CMD:ogclan(playerid, params[])
  120. {
  121. if(IsPlayerInRangeOfPoint(playerid, 7.0, -3.3517,-266.6953,5.4297))
  122. {
  123. if(pInfo[playerid][pClan] == 5)
  124. {
  125. if(clan5stats == false)
  126. {
  127. clan5stats = true;
  128. MoveObject(gate5, -3.2000000,-268.6000100,-1.0000000,1.5);
  129. SCM(playerid, -1, "* {37DB45}The gate was opened");
  130. }else{
  131. clan5stats = false;
  132. SCM(playerid, -1, "* {37DB45}The gate was closed ");
  133. MoveObject(gate5, -3.2000000,-268.6000100,7.2000000,1.5);
  134. }
  135. }
  136. }
  137. return 1;
  138. }
  139.  
  140. CMD:c(playerid,params[])
  141. {
  142. new clanstring[128];
  143. if(pInfo[playerid][pClan])
  144. {
  145. if(!strlen(params))
  146. {
  147. SCM(playerid, -1, ""VER" /C [Message]");
  148. return 1;
  149. }
  150. format(clanstring, sizeof(clanstring), "{006400}[CLAN CHAT] %s[%d] says: {FFFFFF}%s", PlayerName(playerid), playerid, params);
  151. SendMessageToClan(playerid, clanstring, -1);
  152. }
  153. else {
  154. SCM(playerid,-1,"*"RED" You do not have the permissions.!");
  155. }
  156. return 1;
  157. }
  158.  
  159. CMD:kickclan(playerid, params[])
  160. {
  161. if(pInfo[playerid][pLeader] > 0)
  162. {
  163. new targetid, string[128];
  164. if(sscanf(params, "u", targetid)) return SCM(playerid,-1,""VER" /clankick [playerid]");
  165. if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""VER" Player is not online");
  166. if(pInfo[playerid][pLeader] != pInfo[targetid][pClan]) return SCM(playerid, -1, "This member is not part of your clan");
  167. pInfo[targetid][pClan] = 0;
  168. SCM(playerid, -1, "You have been removed from the clan");
  169. format(string, sizeof(string), "Clan Leader %s has kicked %s from the clan", PlayerName(playerid), PlayerName(targetid));
  170. foreach(Player, i)
  171. {
  172. if(pInfo[i][pClan] == pInfo[playerid][pLeader])
  173. {
  174. SCM(i, -1, string);
  175. }
  176. }
  177. SCM(targetid,WHITE,string);
  178. }else{
  179. SCM(playerid, -1, "You don't have permissions ");
  180. }
  181. return 1;
  182. }
  183.  
  184. CMD:inviteclan(playerid,params[])
  185. {
  186.  
  187. if(pInfo[playerid][pLeader] > 0)
  188. {
  189. new targetid, string[128];
  190. if(sscanf(params, "u", targetid)) return SCM(playerid,-1,""RED" /inviteclan [playerid]");
  191. if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""RED" Player is not online");
  192. pInfo[targetid][pClan] = pInfo[playerid][pLeader];
  193.  
  194. format(string, sizeof(string), "*"VER" %s have given clan status of to %s",PlayerName(playerid),PlayerName(targetid));
  195. SCM(targetid,WHITE,string);
  196. SendClientMessage(playerid, -1, "player tal ganhou tal tal tal");
  197. foreach(Player, i)
  198. {
  199. if(pInfo[i][pClan] == pInfo[playerid][pLeader])
  200. {
  201. SCM(i, -1, string);
  202. }
  203. }
  204. SCM(targetid,WHITE,string);
  205. }else{
  206. SCM(playerid, -1, "You don't have permissions ");
  207. }
  208. return 1;
  209. }
  210.  
  211.  
  212. CMD:cleave(playerid, params[])
  213. {
  214. pInfo[playerid][pClan] = 0;
  215. SCM(playerid, -1, ""VER"You have been leave from the clan");
  216. return 1;
  217. }
  218. CMD:membersclan(playerid, params[])
  219. {
  220. if(pInfo[playerid][pClan] > 0)
  221. {
  222. foreach(Player, i)
  223. {
  224.  
  225. if(pInfo[i][pClan] == pInfo[playerid][pClan])
  226. {
  227. new string[128];
  228. format(string, sizeof(string), "%s {006400}[CLAN MEMBER].", PlayerName(i)),PlayerName(playerid);
  229. SCM(playerid, -1, string);
  230.  
  231. }
  232. }
  233. }else{
  234. SCM(playerid, -1, "You don't have clan ");
  235. }
  236. return 1;
  237. }
  238.  
  239. CMD:setleaderclan(playerid, params[])
  240. {
  241. if(IsPlayerAdmin(playerid))
  242. {
  243. new targetid,level,string[128];
  244. if(sscanf(params, "ud", targetid, level)) return SCM(playerid,-1,""VER" /setleader [playerid] [level]");
  245. if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""RED" Player is not online");
  246. if(level < 0 || level > 6) return SCM(playerid,-1,""RED" 0 None, 1 CLAN1, 2 CLAN2, 3 CLAN3 , 4 CLAN4, 5 CLAN5 6 CLAN6");
  247. SendClientMessage(playerid, -1, "player tal ganhou tal tal tal");
  248. pInfo[targetid][pClan] = level;
  249. pInfo[targetid][pLeader] = level;
  250.  
  251. format(string, sizeof(string), "*"VER" %s have given clan leadership status of %d to %s",PlayerName(playerid),level,PlayerName(targetid));
  252. SCM(targetid,WHITE,string);
  253. }else{
  254. SCM(playerid, -1, ""RED" You can not use this command");
  255. }
  256. return 1;
  257. }
  258.  
  259. CMD:setclan(playerid,params[])
  260. {
  261. if(IsPlayerAdmin(playerid))
  262. {
  263. new targetid,level,string[128];
  264. if(sscanf(params, "ud", targetid, level)) return SCM(playerid,-1,""RED" /setclan [playerid] [level]");
  265. if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""RED" Player is not online");
  266. if(level < 0 || level > 6) return SCM(playerid,-1,""RED" 0 None, 1 CLAN1, 2 CLAN2, 3 CLAN3 , 4 CLAN4, 5 CLAN5 6 CLAN6");
  267. SendClientMessage(playerid, -1, "player tal ganhou tal tal tal");
  268. pInfo[targetid][pClan] = level;
  269.  
  270. format(string, sizeof(string), "*"VER" %s have given clan status of %d to %s",PlayerName(playerid),level,PlayerName(targetid));
  271. SCM(targetid,WHITE,string);
  272. }else{
  273. SCM(playerid, -1, ""RED" You can not use this command");
  274. }
  275. return 1;
  276. }
  277.  
  278. CMD:skinclan(playerid, params[])
  279. {
  280. if(pInfo[playerid][pClan] > 0)
  281. {
  282. switch(pInfo[playerid][pClan])
  283. {
  284. case 1:
  285. {
  286. SetPlayerSkin(playerid, 101);
  287. }
  288. case 2:
  289. {
  290. SetPlayerSkin(playerid, 164);
  291. }
  292. case 3:
  293. {
  294. SetPlayerSkin(playerid, 123);
  295. }
  296. case 4:
  297. {
  298. SetPlayerSkin(playerid, 230);
  299. }
  300. case 5:
  301. {
  302. SetPlayerSkin(playerid, 283);
  303. }
  304. case 6:
  305. {
  306. SetPlayerSkin(playerid, 111);
  307. }
  308. }
  309. }
  310. else return SCM(playerid, -1, "ERROR: You are not part of a oficial clan. If you are, ask your leader for clan rights.");
  311. return 1;
  312. }
  313.  
  314. CMD:cmdclan(playerid, params[])
  315. {
  316. if(pInfo[playerid][pClan]){
  317. SCM(playerid, -1, "{DC143C}» {006400}/c [Clan Chat]");
  318. SCM(playerid, -1, "{DC143C}» {006400}/kickclan [ONLY LEADER]");
  319. SCM(playerid, -1, "{DC143C}» {006400}/inviteclan [ONLY LEADER]");
  320. SCM(playerid, -1, "{DC143C}» {006400}/membersclan [Show Clan Members]");
  321. SCM(playerid, -1, "{DC143C}» {006400}/skinclan [Use The Skin Clan]");
  322. SCM(playerid, -1, "{DC143C}» {006400}/cleave [Leave from clan]");
  323. SCM(playerid, -1, "{DC143C}» {006400}/ogclan [Opens The Gate]");
  324. }else{
  325. SCM(playerid, -1, ""RED" You don't have permission");
  326. }
  327. return 1;
  328. }
  329.  
  330. //==========================================================================//
  331. //STOCKS
  332. //==========================================================================//
  333. stock PlayerName(playerid)
  334. {
  335. new ppName[24];
  336. GetPlayerName(playerid, ppName, 24);
  337. return ppName;
  338. }
  339.  
  340. stock GetName(playerid)
  341. {
  342. new Nameee[MAX_PLAYER_NAME];
  343. GetPlayerName(playerid, Nameee, sizeof(Nameee));
  344. return Nameee;
  345. }
  346.  
  347. stock SendMessageToClan(playerid, message[], color)
  348. {
  349. foreach(Player, i)
  350. {
  351. if(pInfo[i][pClan] == pInfo[playerid][pClan])
  352. {
  353. SCM(i, color, message);
  354. }
  355. }
  356. return 1;
  357. }
  358.  
  359. //==========================================================================//
  360. //MAPS
  361. //==========================================================================//
  362. stock Gates()
  363. {
  364. gate5 = CreateObject(980,-3.2000000,-268.6000100,7.2000000,0.0000000,0.0000000,182.0000000); //object(airportgate) (1)
  365. return 1;
  366. }
Add Comment
Please, Sign In to add comment