• Страница 1 из 1
  • 1
[TDM] Захват территорий by legenda
Дмитрий Дата: Вторник, 28.05.2013, 15:48 | Сообщение # 1 | Сообщить о нерабочей теме


Аватар для Дмитрий

Доброго времени суток. Вот решил выложить для вас интересный урок от legenda.
В данном уроке показано как можно сделать хоть и не столь оптимизированный но в полне эффективный рабочий код для захвата многочисленных территорий бандам.

Урок автора:
И так приступим. На просторах интернета я нашел обозначенные территории как на samp-rp они нам кок раз подойдут после сами можете изменить их на свои или добавить
Цитата
1. В самый верх мода вставляем:

Код
new GangZone[91][5];


Цитата
После заходим в public OnGameModeInit():

Код
//Создаем территории
GangZone[1][0]=GangZoneCreate(1625.295166, -2176.507812, 1755.295166, -2036.507812);
GangZone[2][0]=GangZoneCreate(1755.295166, -2176.507812, 1885.295166, -2036.507812);
GangZone[3][0]=GangZoneCreate(1885.295166, -2176.507812, 2015.295166, -2036.507812);
GangZone[4][0]=GangZoneCreate(2015.295166, -2176.507812, 2145.295166, -2036.507812);
GangZone[5][0]=GangZoneCreate(2145.295166, -2176.507812, 2275.295166, -2036.507812);
GangZone[6][0]=GangZoneCreate(2275.295166, -2176.507812, 2405.295166, -2036.507812);
GangZone[7][0]=GangZoneCreate(2405.295166, -2176.507812, 2535.295166, -2036.507812);
GangZone[8][0]=GangZoneCreate(2535.295166, -2176.507812, 2665.295166, -2036.507812);
GangZone[9][0]=GangZoneCreate(2665.295166, -2176.507812, 2795.295166, -2036.507812);
GangZone[10][0]=GangZoneCreate(2795.295166, -2176.507812, 2925.295166, -2036.507812);
GangZone[11][0]=GangZoneCreate(1625.295166, -2036.507812, 1755.295166, -1896.507812);
GangZone[12][0]=GangZoneCreate(1755.295166, -2036.507812, 1885.295166, -1896.507812);
GangZone[13][0]=GangZoneCreate(1885.295166, -2036.507812, 2015.295166, -1896.507812);
GangZone[14][0]=GangZoneCreate(2015.295166, -2036.507812, 2145.295166, -1896.507812);
GangZone[15][0]=GangZoneCreate(2145.295166, -2036.507812, 2275.295166, -1896.507812);
GangZone[16][0]=GangZoneCreate(2275.295166, -2036.507812, 2405.295166, -1896.507812);
GangZone[17][0]=GangZoneCreate(2405.295166, -2036.507812, 2535.295166, -1896.507812);
GangZone[18][0]=GangZoneCreate(2535.295166, -2036.507812, 2665.295166, -1896.507812);
GangZone[19][0]=GangZoneCreate(2665.295166, -2036.507812, 2795.295166, -1896.507812);
GangZone[20][0]=GangZoneCreate(2795.295166, -2036.507812, 2925.295166, -1896.507812);
GangZone[21][0]=GangZoneCreate(1625.295166, -1896.507812, 1755.295166, -1756.507812);
GangZone[22][0]=GangZoneCreate(1755.295166, -1896.507812, 1885.295166, -1756.507812);
GangZone[23][0]=GangZoneCreate(1885.295166, -1896.507812, 2015.295166, -1756.507812);
GangZone[24][0]=GangZoneCreate(2015.295166, -1896.507812, 2145.295166, -1756.507812);
GangZone[25][0]=GangZoneCreate(2145.295166, -1896.507812, 2275.295166, -1756.507812);
GangZone[26][0]=GangZoneCreate(2275.295166, -1896.507812, 2405.295166, -1756.507812);
GangZone[27][0]=GangZoneCreate(2405.295166, -1896.507812, 2535.295166, -1756.507812);
GangZone[28][0]=GangZoneCreate(2535.295166, -1896.507812, 2665.295166, -1756.507812);
GangZone[29][0]=GangZoneCreate(2665.295166, -1896.507812, 2795.295166, -1756.507812);
GangZone[30][0]=GangZoneCreate(2795.295166, -1896.507812, 2925.295166, -1756.507812);
GangZone[31][0]=GangZoneCreate(1625.295166, -1756.507812, 1755.295166, -1616.507812);
GangZone[32][0]=GangZoneCreate(1755.295166, -1756.507812, 1885.295166, -1616.507812);
GangZone[33][0]=GangZoneCreate(1885.295166, -1756.507812, 2015.295166, -1616.507812);
GangZone[34][0]=GangZoneCreate(2015.295166, -1756.507812, 2145.295166, -1616.507812);
GangZone[35][0]=GangZoneCreate(2145.295166, -1756.507812, 2275.295166, -1616.507812);
GangZone[36][0]=GangZoneCreate(2275.295166, -1756.507812, 2405.295166, -1616.507812);
GangZone[37][0]=GangZoneCreate(2405.295166, -1756.507812, 2535.295166, -1616.507812);
GangZone[38][0]=GangZoneCreate(2535.295166, -1756.507812, 2665.295166, -1616.507812);
GangZone[39][0]=GangZoneCreate(2665.295166, -1756.507812, 2795.295166, -1616.507812);
GangZone[40][0]=GangZoneCreate(2795.295166, -1756.507812, 2925.295166, -1616.507812);
GangZone[41][0]=GangZoneCreate(1625.295166, -1616.507812, 1755.295166, -1476.507812);
GangZone[42][0]=GangZoneCreate(1755.295166, -1616.507812, 1885.295166, -1476.507812);
GangZone[43][0]=GangZoneCreate(1885.295166, -1616.507812, 2015.295166, -1476.507812);
GangZone[44][0]=GangZoneCreate(2015.295166, -1616.507812, 2145.295166, -1476.507812);
GangZone[45][0]=GangZoneCreate(2145.295166, -1616.507812, 2275.295166, -1476.507812);
GangZone[46][0]=GangZoneCreate(2275.295166, -1616.507812, 2405.295166, -1476.507812);
GangZone[47][0]=GangZoneCreate(2405.295166, -1616.507812, 2535.295166, -1476.507812);
GangZone[48][0]=GangZoneCreate(2535.295166, -1616.507812, 2665.295166, -1476.507812);
GangZone[49][0]=GangZoneCreate(2665.295166, -1616.507812, 2795.295166, -1476.507812);
GangZone[50][0]=GangZoneCreate(2795.295166, -1616.507812, 2925.295166, -1476.507812);
GangZone[51][0]=GangZoneCreate(1625.295166, -1476.507812, 1755.295166, -1336.507812);
GangZone[52][0]=GangZoneCreate(1755.295166, -1476.507812, 1885.295166, -1336.507812);
GangZone[53][0]=GangZoneCreate(1885.295166, -1476.507812, 2015.295166, -1336.507812);
GangZone[54][0]=GangZoneCreate(2015.295166, -1476.507812, 2145.295166, -1336.507812);
GangZone[55][0]=GangZoneCreate(2145.295166, -1476.507812, 2275.295166, -1336.507812);
GangZone[56][0]=GangZoneCreate(2275.295166, -1476.507812, 2405.295166, -1336.507812);
GangZone[57][0]=GangZoneCreate(2405.295166, -1476.507812, 2535.295166, -1336.507812);
GangZone[58][0]=GangZoneCreate(2535.295166, -1476.507812, 2665.295166, -1336.507812);
GangZone[59][0]=GangZoneCreate(2665.295166, -1476.507812, 2795.295166, -1336.507812);
GangZone[60][0]=GangZoneCreate(2795.295166, -1476.507812, 2925.295166, -1336.507812);
GangZone[61][0]=GangZoneCreate(1625.295166, -1336.507812, 1755.295166, -1196.507812);
GangZone[62][0]=GangZoneCreate(1755.295166, -1336.507812, 1885.295166, -1196.507812);
GangZone[63][0]=GangZoneCreate(1885.295166, -1336.507812, 2015.295166, -1196.507812);
GangZone[64][0]=GangZoneCreate(2015.295166, -1336.507812, 2145.295166, -1196.507812);
GangZone[65][0]=GangZoneCreate(2145.295166, -1336.507812, 2275.295166, -1196.507812);
GangZone[66][0]=GangZoneCreate(2275.295166, -1336.507812, 2405.295166, -1196.507812);
GangZone[67][0]=GangZoneCreate(2405.295166, -1336.507812, 2535.295166, -1196.507812);
GangZone[68][0]=GangZoneCreate(2535.295166, -1336.507812, 2665.295166, -1196.507812);
GangZone[69][0]=GangZoneCreate(2665.295166, -1336.507812, 2795.295166, -1196.507812);
GangZone[70][0]=GangZoneCreate(2795.295166, -1336.507812, 2925.295166, -1196.507812);
GangZone[71][0]=GangZoneCreate(1625.295166, -1196.507812, 1755.295166, -1056.507812);
GangZone[72][0]=GangZoneCreate(1755.295166, -1196.507812, 1885.295166, -1056.507812);
GangZone[73][0]=GangZoneCreate(1885.295166, -1196.507812, 2015.295166, -1056.507812);
GangZone[74][0]=GangZoneCreate(2015.295166, -1196.507812, 2145.295166, -1056.507812);
GangZone[75][0]=GangZoneCreate(2145.295166, -1196.507812, 2275.295166, -1056.507812);
GangZone[76][0]=GangZoneCreate(2275.295166, -1196.507812, 2405.295166, -1056.507812);
GangZone[77][0]=GangZoneCreate(2405.295166, -1196.507812, 2535.295166, -1056.507812);
GangZone[78][0]=GangZoneCreate(2535.295166, -1196.507812, 2665.295166, -1056.507812);
GangZone[79][0]=GangZoneCreate(2665.295166, -1196.507812, 2795.295166, -1056.507812);
GangZone[80][0]=GangZoneCreate(2795.295166, -1196.507812, 2925.295166, -1056.507812);
GangZone[81][0]=GangZoneCreate(1625.295166, -1056.507812, 1755.295166, -916.507812);
GangZone[82][0]=GangZoneCreate(1755.295166, -1056.507812, 1885.295166, -916.507812);
GangZone[83][0]=GangZoneCreate(1885.295166, -1056.507812, 2015.295166, -916.507812);
GangZone[84][0]=GangZoneCreate(2015.295166, -1056.507812, 2145.295166, -916.507812);
GangZone[85][0]=GangZoneCreate(2145.295166, -1056.507812, 2275.295166, -916.507812);
GangZone[86][0]=GangZoneCreate(2275.295166, -1056.507812, 2405.295166, -916.507812);
GangZone[87][0]=GangZoneCreate(2405.295166, -1056.507812, 2535.295166, -916.507812);
GangZone[88][0]=GangZoneCreate(2535.295166, -1056.507812, 2665.295166, -916.507812);
GangZone[89][0]=GangZoneCreate(2665.295166, -1056.507812, 2795.295166, -916.507812);
GangZone[90][0]=GangZoneCreate(2795.295166, -1056.507812, 2925.295166, -916.507812);
//атак же обозначим их цветами:)
GangZone[1][1]=0x00ffffAA;
GangZone[2][1]=0x00ffffAA;
GangZone[3][1]=0x00ffffAA;
GangZone[4][1]=0x00ffffAA;
GangZone[5][1]=0x00ffffAA;
GangZone[6][1]=0x00FF00AA;
GangZone[7][1]=0x00FF00AA;
GangZone[8][1]=0x00FF00AA;
GangZone[9][1]=0x00FF00AA;
GangZone[10][1]=0x00FF00AA;
GangZone[11][1]=0x00ffffAA;
GangZone[12][1]=0x00ffffAA;
GangZone[13][1]=0x00ffffAA;
GangZone[14][1]=0x00ffffAA;
GangZone[15][1]=0x00FF00AA;
GangZone[16][1]=0x00FF00AA;
GangZone[17][1]=0x00FF00AA;
GangZone[18][1]=0x00FF00AA;
GangZone[19][1]=0x00FF00AA;
GangZone[20][1]=0x00FF00AA;
GangZone[21][1]=0x00ffffAA;
GangZone[22][1]=0x00ffffAA;
GangZone[23][1]=0x00ffffAA;
GangZone[24][1]=0x00ffffAA;
GangZone[25][1]=0x00FF00AA;
GangZone[26][1]=0x00FF00AA;
GangZone[27][1]=0x00FF00AA;
GangZone[28][1]=0x00FF00AA;
GangZone[29][1]=0x00FF00AA;
GangZone[30][1]=0x00FF00AA;
GangZone[31][1]=0x00ffffAA;
GangZone[32][1]=0x00ffffAA;
GangZone[33][1]=0x00ffffAA;
GangZone[34][1]=0x00ffffAA;
GangZone[35][1]=0x00FF00AA;
GangZone[36][1]=0x00FF00AA;
GangZone[37][1]=0x00FF00AA;
GangZone[38][1]=0x00FF00AA;
GangZone[39][1]=0x00FF00AA;
GangZone[40][1]=0xFFFF00AA;
GangZone[41][1]=0x00ffffAA;
GangZone[42][1]=0x00ffffAA;
GangZone[43][1]=0x8b00ffAA;
GangZone[44][1]=0x8b00ffAA;
GangZone[45][1]=0x00FF00AA;
GangZone[46][1]=0x00FF00AA;
GangZone[47][1]=0x00FF00AA;
GangZone[48][1]=0x00FF00AA;
GangZone[49][1]=0xFFFF00AA;
GangZone[50][1]=0xFFFF00AA;
GangZone[51][1]=0x8b00ffAA;
GangZone[52][1]=0x8b00ffAA;
GangZone[53][1]=0x8b00ffAA;
GangZone[54][1]=0x8b00ffAA;
GangZone[55][1]=0x8b00ffAA;
GangZone[56][1]=0xFFFF00AA;
GangZone[57][1]=0xFFFF00AA;
GangZone[58][1]=0xFFFF00AA;
GangZone[59][1]=0xFFFF00AA;
GangZone[60][1]=0xFFFF00AA;
GangZone[61][1]=0x8b00ffAA;
GangZone[62][1]=0x8b00ffAA;
GangZone[63][1]=0x8b00ffAA;
GangZone[64][1]=0x8b00ffAA;
GangZone[65][1]=0x8b00ffAA;
GangZone[66][1]=0xFFFF00AA;
GangZone[67][1]=0xFFFF00AA;
GangZone[68][1]=0xFFFF00AA;
GangZone[69][1]=0xFFFF00AA;
GangZone[70][1]=0xFFFF00AA;
GangZone[71][1]=0x8b00ffAA;
GangZone[72][1]=0x8b00ffAA;
GangZone[73][1]=0x8b00ffAA;
GangZone[74][1]=0x8b00ffAA;
GangZone[75][1]=0x8b00ffAA;
GangZone[76][1]=0xFFFF00AA;
GangZone[77][1]=0xFFFF00AA;
GangZone[78][1]=0xFFFF00AA;
GangZone[79][1]=0xFFFF00AA;
GangZone[80][1]=0xFFFF00AA;
GangZone[81][1]=0x8b00ffAA;
GangZone[82][1]=0x8b00ffAA;
GangZone[83][1]=0x8b00ffAA;
GangZone[84][1]=0x8b00ffAA;
GangZone[85][1]=0xFFFF00AA;
GangZone[86][1]=0xFFFF00AA;
GangZone[87][1]=0xFFFF00AA;
GangZone[88][1]=0xFFFF00AA;
GangZone[89][1]=0xFFFF00AA;
GangZone[90][1]=0xFFFF00AA;  


Цитата
Теперь заходим в public OnPlayerConnect(playerid):

Код
for(new i=1;i<91;i++){
GangZoneShowForPlayer(playerid,GangZone[i][0],GangZone[i][1]);//Показываем игроку территории которые захвачены
if(GangZone[i][4]>0){
GangZoneFlashForPlayer(playerid,GangZone[i][0],GangZone[i][1]);}//Показываем игроку территории которые в процессе захвата
}  


Цитата
Теперь заходим в public OnPlayerDeath(playerid,killerid,reason)://В данном паблике идёт основной захват территорий

Код
if(GetPlayerTeam(playerid)!=GetPlayerTeam(killerid)){
if(GetPVarInt(playerid,"GangZone")!=0){
if(GangZone[GetPVarInt(playerid,"GangZone")][2]!=GetPlayerTeam(killerid)){
GangZone[GetPVarInt(playerid,"GangZone")][3]++;
switch(GangZone[GetPVarInt(playerid,"GangZone")][3]){
case 1:{
GangZone[GetPVarInt(playerid,"GangZone")][1]=GetPlayerColor(killerid);
GangZoneFlashForAll(GangZone[GetPVarInt(playerid,"GangZone")][0],GangZone[GetPVarInt(playerid,"GangZone")][1]);
GangZone[GetPVarInt(playerid,"GangZone")][4]=1;
}
case 2:{
GangZoneStopFlashForAll(GangZone[GetPVarInt(playerid,"GangZone")][0]);
GangZone[GetPVarInt(playerid,"GangZone")][2]=GetPlayerTeam(killerid);
GangZone[GetPVarInt(playerid,"GangZone")][1]=GetPlayerColor(killerid);
GangZone[GetPVarInt(playerid,"GangZone")][4]=0;
GangZoneShowForAll(GangZone[GetPVarInt(playerid,"GangZone")][0],GangZone[GetPVarInt(playerid,"GangZone")][1]);
GangZone[GetPVarInt(playerid,"GangZone")][3]=0;
}
}
}
}
}  


Цитата
Теперь нам нужно зайди в public OnPlayerUpdate(playerid):


Код
if(IsPlayerGangZone(playerid,1625.295166, -2176.507812, 1755.295166, -2036.507812))SetPVarInt(playerid,"GangZone",1);
if(IsPlayerGangZone(playerid,1755.295166, -2176.507812, 1885.295166, -2036.507812))SetPVarInt(playerid,"GangZone",2);
if(IsPlayerGangZone(playerid,1885.295166, -2176.507812, 2015.295166, -2036.507812))SetPVarInt(playerid,"GangZone",3);
if(IsPlayerGangZone(playerid,2015.295166, -2176.507812, 2145.295166, -2036.507812))SetPVarInt(playerid,"GangZone",4);
if(IsPlayerGangZone(playerid,2145.295166, -2176.507812, 2275.295166, -2036.507812))SetPVarInt(playerid,"GangZone",5);
if(IsPlayerGangZone(playerid,2275.295166, -2176.507812, 2405.295166, -2036.507812))SetPVarInt(playerid,"GangZone",6);
if(IsPlayerGangZone(playerid,2405.295166, -2176.507812, 2535.295166, -2036.507812))SetPVarInt(playerid,"GangZone",7);
if(IsPlayerGangZone(playerid,2535.295166, -2176.507812, 2665.295166, -2036.507812))SetPVarInt(playerid,"GangZone",8);
if(IsPlayerGangZone(playerid,2665.295166, -2176.507812, 2795.295166, -2036.507812))SetPVarInt(playerid,"GangZone",9);
if(IsPlayerGangZone(playerid,2795.295166, -2176.507812, 2925.295166, -2036.507812))SetPVarInt(playerid,"GangZone",10);
if(IsPlayerGangZone(playerid,1625.295166, -2036.507812, 1755.295166, -1896.507812))SetPVarInt(playerid,"GangZone",11);
if(IsPlayerGangZone(playerid,1755.295166, -2036.507812, 1885.295166, -1896.507812))SetPVarInt(playerid,"GangZone",12);
if(IsPlayerGangZone(playerid,1885.295166, -2036.507812, 2015.295166, -1896.507812))SetPVarInt(playerid,"GangZone",13);
if(IsPlayerGangZone(playerid,2015.295166, -2036.507812, 2145.295166, -1896.507812))SetPVarInt(playerid,"GangZone",14);
if(IsPlayerGangZone(playerid,2145.295166, -2036.507812, 2275.295166, -1896.507812))SetPVarInt(playerid,"GangZone",15);
if(IsPlayerGangZone(playerid,2275.295166, -2036.507812, 2405.295166, -1896.507812))SetPVarInt(playerid,"GangZone",16);
if(IsPlayerGangZone(playerid,2405.295166, -2036.507812, 2535.295166, -1896.507812))SetPVarInt(playerid,"GangZone",17);
if(IsPlayerGangZone(playerid,2535.295166, -2036.507812, 2665.295166, -1896.507812))SetPVarInt(playerid,"GangZone",18);
if(IsPlayerGangZone(playerid,2665.295166, -2036.507812, 2795.295166, -1896.507812))SetPVarInt(playerid,"GangZone",19);
if(IsPlayerGangZone(playerid,2795.295166, -2036.507812, 2925.295166, -1896.507812))SetPVarInt(playerid,"GangZone",20);
if(IsPlayerGangZone(playerid,1625.295166, -1896.507812, 1755.295166, -1756.507812))SetPVarInt(playerid,"GangZone",21);
if(IsPlayerGangZone(playerid,1755.295166, -1896.507812, 1885.295166, -1756.507812))SetPVarInt(playerid,"GangZone",22);
if(IsPlayerGangZone(playerid,1885.295166, -1896.507812, 2015.295166, -1756.507812))SetPVarInt(playerid,"GangZone",23);
if(IsPlayerGangZone(playerid,2015.295166, -1896.507812, 2145.295166, -1756.507812))SetPVarInt(playerid,"GangZone",24);
if(IsPlayerGangZone(playerid,2145.295166, -1896.507812, 2275.295166, -1756.507812))SetPVarInt(playerid,"GangZone",25);
if(IsPlayerGangZone(playerid,2275.295166, -1896.507812, 2405.295166, -1756.507812))SetPVarInt(playerid,"GangZone",26);
if(IsPlayerGangZone(playerid,2405.295166, -1896.507812, 2535.295166, -1756.507812))SetPVarInt(playerid,"GangZone",27);
if(IsPlayerGangZone(playerid,2535.295166, -1896.507812, 2665.295166, -1756.507812))SetPVarInt(playerid,"GangZone",28);
if(IsPlayerGangZone(playerid,2665.295166, -1896.507812, 2795.295166, -1756.507812))SetPVarInt(playerid,"GangZone",29);
if(IsPlayerGangZone(playerid,2795.295166, -1896.507812, 2925.295166, -1756.507812))SetPVarInt(playerid,"GangZone",30);
if(IsPlayerGangZone(playerid,1625.295166, -1756.507812, 1755.295166, -1616.507812))SetPVarInt(playerid,"GangZone",31);
if(IsPlayerGangZone(playerid,1755.295166, -1756.507812, 1885.295166, -1616.507812))SetPVarInt(playerid,"GangZone",32);
if(IsPlayerGangZone(playerid,1885.295166, -1756.507812, 2015.295166, -1616.507812))SetPVarInt(playerid,"GangZone",33);
if(IsPlayerGangZone(playerid,2015.295166, -1756.507812, 2145.295166, -1616.507812))SetPVarInt(playerid,"GangZone",34);
if(IsPlayerGangZone(playerid,2145.295166, -1756.507812, 2275.295166, -1616.507812))SetPVarInt(playerid,"GangZone",35);
if(IsPlayerGangZone(playerid,2275.295166, -1756.507812, 2405.295166, -1616.507812))SetPVarInt(playerid,"GangZone",36);
if(IsPlayerGangZone(playerid,2405.295166, -1756.507812, 2535.295166, -1616.507812))SetPVarInt(playerid,"GangZone",37);
if(IsPlayerGangZone(playerid,2535.295166, -1756.507812, 2665.295166, -1616.507812))SetPVarInt(playerid,"GangZone",38);
if(IsPlayerGangZone(playerid,2665.295166, -1756.507812, 2795.295166, -1616.507812))SetPVarInt(playerid,"GangZone",39);
if(IsPlayerGangZone(playerid,2795.295166, -1756.507812, 2925.295166, -1616.507812))SetPVarInt(playerid,"GangZone",40);
if(IsPlayerGangZone(playerid,1625.295166, -1616.507812, 1755.295166, -1476.507812))SetPVarInt(playerid,"GangZone",41);
if(IsPlayerGangZone(playerid,1755.295166, -1616.507812, 1885.295166, -1476.507812))SetPVarInt(playerid,"GangZone",42);
if(IsPlayerGangZone(playerid,1885.295166, -1616.507812, 2015.295166, -1476.507812))SetPVarInt(playerid,"GangZone",43);
if(IsPlayerGangZone(playerid,2015.295166, -1616.507812, 2145.295166, -1476.507812))SetPVarInt(playerid,"GangZone",44);
if(IsPlayerGangZone(playerid,2145.295166, -1616.507812, 2275.295166, -1476.507812))SetPVarInt(playerid,"GangZone",45);
if(IsPlayerGangZone(playerid,2275.295166, -1616.507812, 2405.295166, -1476.507812))SetPVarInt(playerid,"GangZone",46);
if(IsPlayerGangZone(playerid,2405.295166, -1616.507812, 2535.295166, -1476.507812))SetPVarInt(playerid,"GangZone",47);
if(IsPlayerGangZone(playerid,2535.295166, -1616.507812, 2665.295166, -1476.507812))SetPVarInt(playerid,"GangZone",48);
if(IsPlayerGangZone(playerid,2665.295166, -1616.507812, 2795.295166, -1476.507812))SetPVarInt(playerid,"GangZone",49);
if(IsPlayerGangZone(playerid,2795.295166, -1616.507812, 2925.295166, -1476.507812))SetPVarInt(playerid,"GangZone",50);
if(IsPlayerGangZone(playerid,1625.295166, -1476.507812, 1755.295166, -1336.507812))SetPVarInt(playerid,"GangZone",51);
if(IsPlayerGangZone(playerid,1755.295166, -1476.507812, 1885.295166, -1336.507812))SetPVarInt(playerid,"GangZone",52);
if(IsPlayerGangZone(playerid,1885.295166, -1476.507812, 2015.295166, -1336.507812))SetPVarInt(playerid,"GangZone",53);
if(IsPlayerGangZone(playerid,2015.295166, -1476.507812, 2145.295166, -1336.507812))SetPVarInt(playerid,"GangZone",54);
if(IsPlayerGangZone(playerid,2145.295166, -1476.507812, 2275.295166, -1336.507812))SetPVarInt(playerid,"GangZone",55);
if(IsPlayerGangZone(playerid,2275.295166, -1476.507812, 2405.295166, -1336.507812))SetPVarInt(playerid,"GangZone",56);
if(IsPlayerGangZone(playerid,2405.295166, -1476.507812, 2535.295166, -1336.507812))SetPVarInt(playerid,"GangZone",57);
if(IsPlayerGangZone(playerid,2535.295166, -1476.507812, 2665.295166, -1336.507812))SetPVarInt(playerid,"GangZone",58);
if(IsPlayerGangZone(playerid,2665.295166, -1476.507812, 2795.295166, -1336.507812))SetPVarInt(playerid,"GangZone",59);
if(IsPlayerGangZone(playerid,2795.295166, -1476.507812, 2925.295166, -1336.507812))SetPVarInt(playerid,"GangZone",60);
if(IsPlayerGangZone(playerid,1625.295166, -1336.507812, 1755.295166, -1196.507812))SetPVarInt(playerid,"GangZone",61);
if(IsPlayerGangZone(playerid,1755.295166, -1336.507812, 1885.295166, -1196.507812))SetPVarInt(playerid,"GangZone",62);
if(IsPlayerGangZone(playerid,1885.295166, -1336.507812, 2015.295166, -1196.507812))SetPVarInt(playerid,"GangZone",63);
if(IsPlayerGangZone(playerid,2015.295166, -1336.507812, 2145.295166, -1196.507812))SetPVarInt(playerid,"GangZone",64);
if(IsPlayerGangZone(playerid,2145.295166, -1336.507812, 2275.295166, -1196.507812))SetPVarInt(playerid,"GangZone",65);
if(IsPlayerGangZone(playerid,2275.295166, -1336.507812, 2405.295166, -1196.507812))SetPVarInt(playerid,"GangZone",66);
if(IsPlayerGangZone(playerid,2405.295166, -1336.507812, 2535.295166, -1196.507812))SetPVarInt(playerid,"GangZone",67);
if(IsPlayerGangZone(playerid,2535.295166, -1336.507812, 2665.295166, -1196.507812))SetPVarInt(playerid,"GangZone",68);
if(IsPlayerGangZone(playerid,2665.295166, -1336.507812, 2795.295166, -1196.507812))SetPVarInt(playerid,"GangZone",69);
if(IsPlayerGangZone(playerid,2795.295166, -1336.507812, 2925.295166, -1196.507812))SetPVarInt(playerid,"GangZone",70);
if(IsPlayerGangZone(playerid,1625.295166, -1196.507812, 1755.295166, -1056.507812))SetPVarInt(playerid,"GangZone",71);
if(IsPlayerGangZone(playerid,1755.295166, -1196.507812, 1885.295166, -1056.507812))SetPVarInt(playerid,"GangZone",72);
if(IsPlayerGangZone(playerid,1885.295166, -1196.507812, 2015.295166, -1056.507812))SetPVarInt(playerid,"GangZone",73);
if(IsPlayerGangZone(playerid,2015.295166, -1196.507812, 2145.295166, -1056.507812))SetPVarInt(playerid,"GangZone",74);
if(IsPlayerGangZone(playerid,2145.295166, -1196.507812, 2275.295166, -1056.507812))SetPVarInt(playerid,"GangZone",75);
if(IsPlayerGangZone(playerid,2275.295166, -1196.507812, 2405.295166, -1056.507812))SetPVarInt(playerid,"GangZone",76);
if(IsPlayerGangZone(playerid,2405.295166, -1196.507812, 2535.295166, -1056.507812))SetPVarInt(playerid,"GangZone",77);
if(IsPlayerGangZone(playerid,2535.295166, -1196.507812, 2665.295166, -1056.507812))SetPVarInt(playerid,"GangZone",78);
if(IsPlayerGangZone(playerid,2665.295166, -1196.507812, 2795.295166, -1056.507812))SetPVarInt(playerid,"GangZone",79);
if(IsPlayerGangZone(playerid,2795.295166, -1196.507812, 2925.295166, -1056.507812))SetPVarInt(playerid,"GangZone",80);
if(IsPlayerGangZone(playerid,1625.295166, -1056.507812, 1755.295166, -916.507812))SetPVarInt(playerid,"GangZone",81);
if(IsPlayerGangZone(playerid,1755.295166, -1056.507812, 1885.295166, -916.507812))SetPVarInt(playerid,"GangZone",82);
if(IsPlayerGangZone(playerid,1885.295166, -1056.507812, 2015.295166, -916.507812))SetPVarInt(playerid,"GangZone",83);
if(IsPlayerGangZone(playerid,2015.295166, -1056.507812, 2145.295166, -916.507812))SetPVarInt(playerid,"GangZone",84);
if(IsPlayerGangZone(playerid,2145.295166, -1056.507812, 2275.295166, -916.507812))SetPVarInt(playerid,"GangZone",85);
if(IsPlayerGangZone(playerid,2275.295166, -1056.507812, 2405.295166, -916.507812))SetPVarInt(playerid,"GangZone",86);
if(IsPlayerGangZone(playerid,2405.295166, -1056.507812, 2535.295166, -916.507812))SetPVarInt(playerid,"GangZone",87);
if(IsPlayerGangZone(playerid,2535.295166, -1056.507812, 2665.295166, -916.507812))SetPVarInt(playerid,"GangZone",88);
if(IsPlayerGangZone(playerid,2665.295166, -1056.507812, 2795.295166, -916.507812))SetPVarInt(playerid,"GangZone",89);
if(IsPlayerGangZone(playerid,2795.295166, -1056.507812, 2925.295166, -916.507812))SetPVarInt(playerid,"GangZone",90);
if(IsPlayerGangZone(playerid,1625.295166, -916.507812, 1755.295166, -776.507812))SetPVarInt(playerid,"GangZone",91);
if(IsPlayerGangZone(playerid,1755.295166, -916.507812, 1885.295166, -776.507812))SetPVarInt(playerid,"GangZone",92);
if(IsPlayerGangZone(playerid,1885.295166, -916.507812, 2015.295166, -776.507812))SetPVarInt(playerid,"GangZone",93);
if(IsPlayerGangZone(playerid,2015.295166, -916.507812, 2145.295166, -776.507812))SetPVarInt(playerid,"GangZone",94);
if(IsPlayerGangZone(playerid,2145.295166, -916.507812, 2275.295166, -776.507812))SetPVarInt(playerid,"GangZone",95);
if(IsPlayerGangZone(playerid,2275.295166, -916.507812, 2405.295166, -776.507812))SetPVarInt(playerid,"GangZone",96);
if(IsPlayerGangZone(playerid,2405.295166, -916.507812, 2535.295166, -776.507812))SetPVarInt(playerid,"GangZone",97);
if(IsPlayerGangZone(playerid,2535.295166, -916.507812, 2665.295166, -776.507812))SetPVarInt(playerid,"GangZone",98);
if(IsPlayerGangZone(playerid,2665.295166, -916.507812, 2795.295166, -776.507812))SetPVarInt(playerid,"GangZone",99);
if(IsPlayerGangZone(playerid,2795.295166, -916.507812, 2925.295166, -776.507812))SetPVarInt(playerid,"GangZone",100);  


Цитата
Атак же нам нужно добавить stock:

Код
stock IsPlayerGangZone(playerid,Float:min_x,Float:min_y,Float:max_x,Float:max_y)
{
new Float:xx,Float:yy,Float:zz;
GetPlayerPos(playerid,xx,yy,zz);
if(IsPlayerInAnyVehicle(playerid)){
GetVehiclePos(GetPlayerVehicleID(playerid),xx,yy,zz);
}
if((xx <= max_x && xx >= min_x) && (yy <= max_y && yy >= min_y))return 1;
return 0;
}  


Естественно стоку и ганг зоны не я чертил и хз кто их создатель а основная работа:
by legenda special for noob Antoxa_Willson gunsmilie


From Russia With Love!
  • Страница 1 из 1
  • 1
Поиск: