Advertisement
Guest User

Untitled

a guest
Nov 30th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.72 KB | None | 0 0
  1. /*
  2. Gang system by Abaddon
  3. */
  4. #include <a_samp>
  5. #include <dini>
  6. #include <sscanf>
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Blank Filterscript by your name here");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22.  
  23. #else
  24.  
  25. main()
  26. {
  27. print("\n----------------------------------");
  28. print(" Blank Gamemode by your name here");
  29. print("----------------------------------\n");
  30. }
  31.  
  32. #endif
  33. new tcount;
  34. stock ReturnUser(text[], playerid = INVALID_PLAYER_ID)
  35. {
  36. new pos = 0;
  37. while (text[pos] < 0x21) // Strip out leading spaces
  38. {
  39. if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
  40. pos++;
  41. }
  42. new userid = INVALID_PLAYER_ID;
  43. if (IsNumeric(text[pos])) // Check whole passed string
  44. {
  45. // If they have a numeric name you have a problem (although names are checked on id failure)
  46. userid = strval(text[pos]);
  47. if (userid >=0 && userid < MAX_PLAYERS)
  48. {
  49. if(!IsPlayerConnected(userid))
  50. {
  51. userid = INVALID_PLAYER_ID;
  52. }
  53. else
  54. {
  55. return userid; // A player was found
  56. }
  57. }
  58. }
  59. // They entered [part of] a name or the id search failed (check names just incase)
  60. new len = strlen(text[pos]);
  61. new count = 0;
  62. new name[MAX_PLAYER_NAME];
  63. for (new i = 0; i < MAX_PLAYERS; i++)
  64. {
  65. if (IsPlayerConnected(i))
  66. {
  67. GetPlayerName(i, name, sizeof (name));
  68. if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
  69. {
  70. if (len == strlen(name)) // Exact match
  71. {
  72. return i; // Return the exact player on an exact match
  73. }
  74. else // Partial match
  75. {
  76. count++;
  77. userid = i;
  78. }
  79. }
  80. }
  81. }
  82. if (count != 1)
  83. {
  84. if (playerid != INVALID_PLAYER_ID)
  85. {
  86. if (count)
  87. {
  88. SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow search.");
  89. }
  90. else
  91. {
  92. SendClientMessage(playerid, 0xFF0000AA, "No matching user found.");
  93. }
  94. }
  95. userid = INVALID_PLAYER_ID;
  96. }
  97. return userid; // INVALID_PLAYER_ID for bad return
  98. }
  99. IsNumeric(const string[])
  100. {
  101. for (new i = 0, j = strlen(string); i < j; i++)
  102. {
  103. if (string[i] > '9' || string[i] < '0') return 0;
  104. }
  105. return 1;
  106. }
  107.  
  108. strtok(const string[], &index)
  109. {
  110. new length = strlen(string);
  111. while ((index < length) && (string[index] <= ' '))
  112. {
  113. index++;
  114. }
  115.  
  116. new offset = index;
  117. new result[20];
  118. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  119. {
  120. result[index - offset] = string[index];
  121. index++;
  122. }
  123. result[index - offset] = EOS;
  124. return result;
  125. }
  126.  
  127. stock GetName(playerid)
  128. {
  129. new pname[MAX_PLAYER_NAME]; pname="Íåâàëèäíî ID íà èãðà÷.";
  130. if(IsPlayerConnected(playerid)) {
  131. GetPlayerName(playerid, pname, sizeof (pname));
  132. }
  133. return pname;
  134. }
  135.  
  136. #define MAX_GANGS 3
  137. #define CIVIL 0
  138. #define VIP 1
  139. #define GROVE 2
  140. #define COLOR_VIP 0xFC4242FF
  141. #define TURF_CIVIL 0x00000088
  142. #define TURF_VIP 0xFC424288
  143. #define TURF_GROVE 0xx00D61D88
  144. #define COLOR_GROVE 0x00D61DFF
  145. #define MAX_TURFS 10
  146. #define DIALOG_TURFS 1898
  147. static pGang[MAX_PLAYERS];
  148.  
  149. enum info
  150. {
  151. pMember,
  152. pLeader,
  153. pAttacker
  154. }
  155.  
  156. new pInfo[MAX_PLAYERS][info];
  157.  
  158. enum gInfo
  159. {
  160. gName[40],
  161. gTurfs,
  162. gBalance,
  163. gTurfTime,
  164. gColor,
  165. gTurfColor,
  166. gRank1[40],
  167. gRank2[40],
  168. gRank3[40],
  169. gRank4[40],
  170. gRank5[40],
  171. gRank6[40]
  172. }
  173.  
  174. new GangInfo[MAX_GANGS][gInfo] = {
  175. {"CIVILIAN",0,0,5*60,-1,TURF_CIVIL,"None","None","None","None","None","None"},
  176. {"VIP",0,0,5*60,COLOR_VIP,TURF_VIP,"Newbie","Progressive","Adapted","Left Hand","Right Hand","Leader"},
  177. {"Grove Street Families",0,0,5*60,COLOR_VIP,"Gangsta","OG","Double OG","Left Hand","Right Hand","Boss"}
  178. };
  179.  
  180. enum tInfo
  181. {
  182. tId,
  183. tName[40],
  184. tCity[40],
  185. tOwnedBy,
  186. tColor,
  187. Float:tMinX,
  188. Float:tMinY,
  189. Float:tMaxX,
  190. Float:tMaxY
  191. }
  192. new TurfInfo[MAX_TURFS][tInfo] = {
  193. {0,"VIP BASE","LS",CIVIL,0x00000088,1099.6410,-2085.1479,1286.3158,-1996.8062}, // i can start turf attack only in this turf
  194. {1,"LOS SANTOS VAGOS TERRITORY","LS",CIVIL,0x00000088,2445.889892, -1160.060913, 2733.889892, -992.060913},
  195. {2,"BOUNTY HUNTER TERRITORY","LS",CIVIL,0x00000088,658.115905, -1342.275024, 802.115905, -1222.275024},
  196. {3,"GROVE STREET FAMILIES TERRITORY","LS",CIVIL,0x00000088,2428.630371, -1734.706665, 2556.630371, -1606.706665},
  197. {4,"GROVE STREET FAMILIES TERRITORY 1","LS",CIVIL,0x00000088,2343.880126, -1736.390380, 2423.880126, -1560.390380},
  198. {5,"LS TOWER","LS",CIVIL,0x00000088,1479.914428, -1410.200073, 1599.914428, -1298.200073},
  199. {6,"LS BEACH","LS",CIVIL,0x00000088,153.607788, -1915.986083, 377.607788, -1747.986083},
  200. {7,"LS BEACH 1","LS",CIVIL,0x00000088,390.188720, -1917.991088, 710.188720, -1789.991088},
  201. {8,"LS AIRPORT","LS",CIVIL,0x00000088,1352.791259, -2401.828857, 1584.791259, -2185.828857},
  202. {9,"LS AIRPORT 1","LS",CIVIL,0x00000088,1563.622070, -2413.599121, 1851.622070, -2173.599121}
  203. };
  204.  
  205. new TurfAttacked[MAX_TURFS] = 0;
  206. new TurfAttackedBy[MAX_TURFS] = 0;
  207. new TurfAttackedTime[MAX_TURFS] = 0;
  208.  
  209. stock IsPlayerInTurf(playerid,turfid)
  210. {
  211. new Float:x,Float:y,Float:z;
  212. GetPlayerPos(playerid,x,y,z);
  213. if (x > TurfInfo[turfid][tMinX] && x < TurfInfo[turfid][tMaxX] && y > TurfInfo[turfid][tMinY] && y < TurfInfo[turfid][tMaxY])
  214. {
  215. return 1;
  216. }
  217. return 0;
  218. }
  219.  
  220. stock GetAttackersInTurf(turfid)
  221. {
  222. new acount = 0;
  223. for(new i=0;i<MAX_PLAYERS;i++)
  224. {
  225. if(IsPlayerConnected(i) && IsPlayerInTurf(i,turfid) && pInfo[i][pAttacker] == 1)
  226. {
  227. count++;
  228. }
  229. }
  230. return acount;
  231. }
  232.  
  233. stock GetPlayersInTurf(turfid)
  234. {
  235. new count = 0;
  236. for(new i=0;i<MAX_PLAYERS;i++)
  237. {
  238. if(IsPlayerConnected(i) && IsPlayerInTurf(i,turfid))
  239. {
  240. count++;
  241. }
  242. }
  243. return count;
  244. }
  245.  
  246. stock SendAdminMessage(color,string[])
  247. {
  248. for(new i=0; i < MAX_PLAYERS;i++)
  249. {
  250. if(IsPlayerAdmin(i))
  251. {
  252. format(string,sizeof(string),"%s",string);
  253. SendClientMessage(i,0xFF0000FF,string);
  254. }
  255. }
  256. return 1;
  257. }
  258.  
  259. stock SaveTurfs()
  260. {
  261. for(new t=0;t<MAX_TURFS;t++)
  262. {
  263. new tpath[200];
  264. format(tpath,sizeof(tpath),"/Turfs/%d.ini",TurfInfo[t][tId]);
  265. if(dini_Exists(tpath))
  266. {
  267. dini_IntSet(tpath,"OwnedBy",TurfInfo[t][tOwnedBy]);
  268. dini_IntSet(tpath,"Color",TurfInfo[t][tColor]);
  269. }
  270. else
  271. {
  272. dini_Create(tpath);
  273. dini_IntSet(tpath,"OwnedBy",CIVIL);
  274. dini_IntSet(tpath,"Color",0x00000088);
  275. }
  276. }
  277. return 1;
  278. }
  279.  
  280. stock LoadTurfs()
  281. {
  282. for(new t=0;t<MAX_TURFS;t++)
  283. {
  284. new tpath[200];
  285. format(tpath,sizeof(tpath),"/Turfs/%d.ini",TurfInfo[t][tId]);
  286. if(dini_Exists(tpath))
  287. {
  288. TurfInfo[t][tOwnedBy] = dini_Int(tpath,"OwnedBy");
  289. TurfInfo[t][tColor] = dini_Int(tpath,"Color");
  290. TurfInfo[t][tId] = GangZoneCreate(TurfInfo[t][tMinX],TurfInfo[t][tMinY],TurfInfo[t][tMaxX],TurfInfo[t][tMaxY]);
  291. }
  292. }
  293. return 1;
  294. }
  295.  
  296. forward CheckTurfs();
  297.  
  298. public OnGameModeInit()
  299. {
  300. LoadTurfs();
  301. SetTimer("CheckTurfs",1000,true);
  302. AddStaticVehicle(522,1259.1997,-2016.8817,58.9971,12.5053,2,2);
  303. /*for(new t=0; t < sizeof(TurfInfo); t++)
  304. {
  305. TurfInfo[t][tId] = GangZoneCreate(TurfInfo[t][tMinX],TurfInfo[t][tMinY],TurfInfo[t][tMaxX],TurfInfo[t][tMaxY]);
  306. }*/
  307. SetGameModeText("Blank Script");
  308. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  309. return 1;
  310. }
  311.  
  312. public OnGameModeExit()
  313. {
  314. SaveTurfs();
  315. return 1;
  316. }
  317.  
  318. public OnPlayerRequestClass(playerid, classid)
  319. {
  320. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  321. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  322. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  323. return 1;
  324. }
  325.  
  326. public OnPlayerConnect(playerid)
  327. {
  328. new plrIP[256],ippath[256],string[1000];
  329. GetPlayerIp(playerid,plrIP,sizeof(plrIP));
  330. format(ippath,sizeof(ippath),"/RolePlay/Ips/%s.ini",plrIP);
  331.  
  332. for(new t=0; t < MAX_TURFS; t++)
  333. {
  334. GangZoneShowForPlayer(playerid,TurfInfo[t][tId],TurfInfo[t][tColor]);
  335. }
  336.  
  337. if(!dini_Exists(ippath))
  338. {
  339. dini_Create(ippath);
  340. dini_Set(ippath,"NickName",GetName(playerid));
  341. }
  342. else
  343. {
  344. if(strcmp(dini_Get(ippath,"NickName"),GetName(playerid),true)!=0)
  345. {
  346. format(string,sizeof(string),"Report from THE SEREVR for %s [Reason: MultiAcc]",GetName(playerid));
  347. SendAdminMessage(-1,string);
  348. }
  349. }
  350. return 1;
  351. }
  352.  
  353. public OnPlayerDisconnect(playerid, reason)
  354. {
  355. return 1;
  356. }
  357.  
  358. public OnPlayerSpawn(playerid)
  359. {
  360. SetPlayerPos(playerid,1259.1997,-2016.8817,58.9971);
  361. return 1;
  362. }
  363.  
  364. public OnPlayerDeath(playerid, killerid, reason)
  365. {
  366. new string[2000];
  367. for(new t=0;t<MAX_TURFS;t++)
  368. {
  369. if(!IsPlayerInTurf(playerid,TurfInfo[t][tId]))
  370. {
  371. if(TurfAttacked[TurfInfo[t][tId]] == 1)
  372. {
  373. if(TurfAttackedBy[TurfInfo[t][tId]] == pGang[playerid])
  374. {
  375. if(pInfo[playerid][pAttacker] == 1)
  376. {
  377. if(GetPlayersInTurf(TurfInfo[t][tId]) > 0)
  378. {
  379. pInfo[playerid][pAttacker] = 0;
  380. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}íàïóñíà î÷åðòàíèÿòà íà òåðèòîðèÿòà è âå÷å íå å ATTACKER!",GetName(playerid));
  381. SendClientMessageToAll(-1,string);
  382. }
  383. else
  384. {
  385. GangZoneStopFlashForAll(TurfInfo[t][tId]);
  386. TurfAttacked[TurfInfo[t][tId]] = 0;
  387. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}íàïóñíà î÷åðòàíèÿòà íà òåðèòîðèÿòà è âå÷å íå å ATTACKER!",GetName(playerid));
  388. SendClientMessageToAll(-1,string);
  389. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}íå óñïÿ äà ïðåâçåìå òåðèòîðèÿòà {FF0000}%s {FFAAFF}, êîÿòî ñå íàìèðà â {FF0000}%s{FFAAFF}!",GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gName],TurfInfo[TurfInfo[t][tId]][tName],TurfInfo[TurfInfo[t][tId]][tCity]);
  390. SendClientMessageToAll(-1,string);
  391. }
  392. }
  393. }
  394. }
  395. }
  396. }
  397. return 1;
  398. }
  399.  
  400. public OnVehicleSpawn(vehicleid)
  401. {
  402. return 1;
  403. }
  404.  
  405. public OnVehicleDeath(vehicleid, killerid)
  406. {
  407. return 1;
  408. }
  409.  
  410. public OnPlayerText(playerid, text[])
  411. {
  412. if(pInfo[playerid][pMember] > 0)
  413. {
  414. new string[2000];
  415. format(string,sizeof(string),"[%s]: %s:[ID:%d]: {FFFFFF}%s",GangInfo[pGang[playerid]][gName],GetName(playerid),playerid,text);
  416. SendClientMessageToAll(GangInfo[pGang[playerid]][gColor],string);
  417. return 0;
  418. }
  419. return 1;
  420. }
  421.  
  422. public OnPlayerCommandText(playerid, cmdtext[])
  423. {
  424.  
  425. new cmd[128], idx;
  426. cmd = strtok(cmdtext, idx);
  427. new tmp[128];
  428. new string[2000];
  429. new params[1000];
  430.  
  431. if(strcmp(cmd,"/checkturf",true)==0)
  432. {
  433. for(new t=0;t<MAX_TURFS;t++)
  434. {
  435. if(IsPlayerInTurf(playerid,t))
  436. {
  437. format(string,sizeof(string),"{FFAAFF}Òàçè òåðèòîðèÿ ïðèíàäëåæè íà {FF0000}%s{FFAAFF}.",GangInfo[TurfInfo[t][tOwnedBy]][gName]);
  438. SendClientMessage(playerid,-1,string);
  439. }
  440. }
  441. return 1;
  442. }
  443.  
  444. if(strcmp(cmd,"/turfs",true)==0)
  445. {
  446. for(new t=0;t<MAX_TURFS;t++)
  447. {
  448. if(TurfInfo[t][tOwnedBy] == CIVIL)
  449. {
  450. tcount++;
  451. }
  452. }
  453. format(string,sizeof(string),"{0DFF00}1. {00D5FF}VIP ïðèòåæàâà: {FF0000}%d òåðèòîðèè\n\n\n{FF0000}Áðîé Civil òåðèòîðèè:{FFFFFF} %d",GangInfo[VIP][gTurfs],tcount);
  454. ShowPlayerDialog(playerid,DIALOG_TURFS,DIALOG_STYLE_MSGBOX,"Áðîé òåðèòîðèè:",string,"Èçëåç","");
  455. return 1;
  456. }
  457.  
  458. sscanf(cmdtext, "s[28]S()[100]", cmd, params);
  459. if(strcmp(cmd,"/setturftime",true)==0)
  460. {
  461. new team[60],time;
  462. if(sscanf(params,"s[60]i",team,time)) return SendClientMessage(playerid,-1,"Èçïîëçâàé: /setturftime [TEAM] [TIME]");
  463. if(strcmp(team,"VIP",true)==0)
  464. {
  465. if(time > 0)
  466. {
  467. format(string,sizeof(string),"Òè ïðîìåíè âðåìåòî çà àòàêà íà òåðèòîðèÿ íà VIP íà %d",time);
  468. GangInfo[VIP][gTurfTime] = time;
  469. }
  470. }
  471.  
  472. return 1;
  473. }
  474.  
  475. if(strcmp(cmd,"/makemeleader",true)==0)
  476. {
  477. pInfo[playerid][pMember] = 1;
  478. pInfo[playerid][pLeader] = 1;
  479. pGang[playerid] = 1;
  480. format(string,sizeof(string),"*** %s áåøå íàçíà÷åí çà ëèäåð íà áàíäà/ìàôèÿ %s ***",GetName(playerid),GangInfo[1][gName]);
  481. SendClientMessageToAll(-1,string);
  482. return 1;
  483. }
  484.  
  485. if(strcmp(cmd,"/turfattack",true)==0)
  486. {
  487. if(pInfo[playerid][pLeader] >= 1)
  488. {
  489. for(new turf=0;turf<sizeof(TurfInfo);turf++)
  490. {
  491. if(IsPlayerInTurf(playerid,turf))
  492. {
  493. if(TurfAttacked[turf] != 1)
  494. {
  495. GangZoneFlashForAll(TurfInfo[turf][tId],GangInfo[pGang[playerid]][gTurfColor]);
  496. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}çàïî÷íà àòàêà íàä òåðèòîðèÿ {FF0000}%s {FFAAFF}, êîÿòî ñå íàìèðà â {FF0000}%s!",GangInfo[pGang[playerid]][gName],TurfInfo[turf][tName],TurfInfo[turf][tCity]);
  497. SendClientMessageToAll(-1,string);
  498. TurfAttacked[TurfInfo[turf][tId]] = 1;
  499. pInfo[playerid][pAttacker] = 1;
  500. TurfAttackedBy[turf] = pGang[playerid];
  501. new w = GetPlayerWantedLevel(playerid);
  502. SetPlayerWantedLevel(playerid,w+2);
  503. if(pGang[GetPlayersInTurf(turf)] == pGang[playerid])
  504. {
  505. new w2 = GetPlayerWantedLevel(GetPlayersInTurf(turf));
  506. pInfo[GetPlayersInTurf(turf)][pAttacker] = 1;
  507. SetPlayerWantedLevel(GetPlayersInTurf(turf),w2+2);
  508. }
  509. }
  510. else
  511. {
  512. SendClientMessage(playerid,-1,"Òàçè òåðèòîðèÿ âå÷å å àòàêóâàíà!");
  513. return 1;
  514. }
  515. }
  516. else
  517. {
  518. SendClientMessage(playerid,-1,"Òðÿáâà äà ñè â òåðèòîðèÿ!");
  519. return 1;
  520. }
  521. }
  522. }
  523. else
  524. {
  525. SendClientMessage(playerid,-1,"Íÿìàø äîñòàòú÷íî ïðàâà çà òàçè êîìàíäà!");
  526. return 1;
  527. }
  528. return 1;
  529. }
  530.  
  531. if(strcmp(cmd,"/makeleader",true)==0)
  532. {
  533. tmp = strtok(cmdtext,idx);
  534. if(!strlen(tmp))
  535. {
  536. SendClientMessage(playerid,-1,"Èçïîëçâàé: /makeleader [playerid] [team]");
  537. return 1;
  538. }
  539. new player;
  540. new team[40];
  541. player = ReturnUser(tmp);
  542. tmp = strtok(cmdtext,idx);
  543. if(!strlen(tmp))
  544. {
  545. SendClientMessage(playerid,-1,"Èçïîëçâàé: /makeleader [playerid] [team]");
  546. return 1;
  547. }
  548. strmid(team,tmp,0,sizeof(team),sizeof(team));
  549. if(IsPlayerConnected(player))
  550. {
  551. if(player != INVALID_PLAYER_ID)
  552. {
  553. if(strcmp(team,"VIP",0)==true)
  554. {
  555. pInfo[player][pMember] = 1;
  556. pInfo[player][pLeader] = 1;
  557. pGang[player] = 1;
  558. format(string,sizeof(string),"*** %s áåøå íàçíà÷åí çà ëèäåð íà áàíäà/ìàôèÿ %s ***",GetName(player),GangInfo[1][gName]);
  559. SendClientMessageToAll(-1,string);
  560. }
  561. }
  562. }
  563. return 1;
  564. }
  565. return 0;
  566. }
  567.  
  568. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  569. {
  570. return 1;
  571. }
  572.  
  573. public OnPlayerExitVehicle(playerid, vehicleid)
  574. {
  575. return 1;
  576. }
  577.  
  578. public OnPlayerStateChange(playerid, newstate, oldstate)
  579. {
  580. return 1;
  581. }
  582.  
  583. public OnPlayerEnterCheckpoint(playerid)
  584. {
  585. return 1;
  586. }
  587.  
  588. public OnPlayerLeaveCheckpoint(playerid)
  589. {
  590. return 1;
  591. }
  592.  
  593. public OnPlayerEnterRaceCheckpoint(playerid)
  594. {
  595. return 1;
  596. }
  597.  
  598. public OnPlayerLeaveRaceCheckpoint(playerid)
  599. {
  600. return 1;
  601. }
  602.  
  603. public OnRconCommand(cmd[])
  604. {
  605. return 1;
  606. }
  607.  
  608. public OnPlayerRequestSpawn(playerid)
  609. {
  610. return 1;
  611. }
  612.  
  613. public OnObjectMoved(objectid)
  614. {
  615. return 1;
  616. }
  617.  
  618. public OnPlayerObjectMoved(playerid, objectid)
  619. {
  620. return 1;
  621. }
  622.  
  623. public OnPlayerPickUpPickup(playerid, pickupid)
  624. {
  625. return 1;
  626. }
  627.  
  628. public OnVehicleMod(playerid, vehicleid, componentid)
  629. {
  630. return 1;
  631. }
  632.  
  633. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  634. {
  635. return 1;
  636. }
  637.  
  638. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  639. {
  640. return 1;
  641. }
  642.  
  643. public OnPlayerSelectedMenuRow(playerid, row)
  644. {
  645. return 1;
  646. }
  647.  
  648. public OnPlayerExitedMenu(playerid)
  649. {
  650. return 1;
  651. }
  652.  
  653. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  654. {
  655. return 1;
  656. }
  657.  
  658. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  659. {
  660. return 1;
  661. }
  662.  
  663. public OnRconLoginAttempt(ip[], password[], success)
  664. {
  665. return 1;
  666. }
  667.  
  668. public OnPlayerUpdate(playerid)
  669. {
  670. new string[2000];
  671. for(new t=0;t<MAX_TURFS;t++)
  672. {
  673. if(!IsPlayerInTurf(playerid,TurfInfo[t][tId]))
  674. {
  675. if(TurfAttacked[TurfInfo[t][tId]] == 1)
  676. {
  677. if(TurfAttackedBy[TurfInfo[t][tId]] == pGang[playerid])
  678. {
  679. if(pInfo[playerid][pAttacker] == 1)
  680. {
  681. if(GetPlayersInTurf(TurfInfo[t][tId]) > 0)
  682. {
  683. pInfo[playerid][pAttacker] = 0;
  684. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}íàïóñíà î÷åðòàíèÿòà íà òåðèòîðèÿòà è âå÷å íå å ATTACKER!",GetName(playerid));
  685. SendClientMessageToAll(-1,string);
  686. }
  687. else
  688. {
  689. GangZoneStopFlashForAll(TurfInfo[t][tId]);
  690. TurfAttacked[TurfInfo[t][tId]] = 0;
  691. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}íå óñïÿ äà ïðåâçåìå òåðèòîðèÿòà {FF0000}%s {FFAAFF}, êîÿòî ñå íàìèðà â {FF0000}%s{FFAAFF}!",GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gName],TurfInfo[TurfInfo[t][tId]][tName],TurfInfo[TurfInfo[t][tId]][tCity]);
  692. SendClientMessageToAll(-1,string);
  693. }
  694. }
  695. }
  696. }
  697. }
  698. }
  699. return 1;
  700. }
  701.  
  702. public OnPlayerStreamIn(playerid, forplayerid)
  703. {
  704. return 1;
  705. }
  706.  
  707. public OnPlayerStreamOut(playerid, forplayerid)
  708. {
  709. return 1;
  710. }
  711.  
  712. public OnVehicleStreamIn(vehicleid, forplayerid)
  713. {
  714. return 1;
  715. }
  716.  
  717. public OnVehicleStreamOut(vehicleid, forplayerid)
  718. {
  719. return 1;
  720. }
  721.  
  722. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  723. {
  724. return 1;
  725. }
  726.  
  727. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  728. {
  729. return 1;
  730. }
  731.  
  732. public CheckTurfs()
  733. {
  734. new string[2000];
  735. for(new t=0;t<MAX_PLAYERS;t++)
  736. {
  737. if(TurfAttacked[TurfInfo[t][tId]] == 1)
  738. {
  739. if(TurfAttackedTime[TurfInfo[t][tId]] >= GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gTurfTime])
  740. {
  741. format(string,sizeof(string),"{FFAAFF}[TURF WAR]: {FF0000}%s {FFAAFF}ïðåâçå òåðèòîðèÿòà {FF0000}%s {FFAAFF}êîÿòî ñå íàìèðà â {FF0000}%s{FFAAFF}!",GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gName],TurfInfo[t][tName],TurfInfo[t][tCity]);
  742. SendClientMessageToAll(-1,string);
  743. TurfAttacked[TurfInfo[t][tId]] = 0;
  744. TurfInfo[t][tColor] = GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gTurfColor];
  745. GangZoneStopFlashForAll(TurfInfo[t][tId]);
  746. GangZoneShowForAll(TurfInfo[t][tId],TurfInfo[t][tColor]);
  747. GangInfo[TurfAttackedBy[TurfInfo[t][tId]]][gTurfs]++;
  748. tcount --;
  749. }
  750. else
  751. {
  752. TurfAttackedTime[TurfInfo[t][tId]]++;
  753. return 1;
  754. }
  755. }
  756. }
  757. return 1;
  758. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement