if(IWantHelp == true) return HelpMe, Rep++;
#1

Hello i have a gang system
PHP код:
#define ZONE0 0
#define ZONE1 1
#define ZONE2 2
#define ZONE3 3
#define ZONE4 4
#define ZONE5 5
#define ZONE6 6
#define ZONE7 7
#define ZONE8 8
#define ZONE9 9
#define ZONE10 10
#define ZONE11 11
#define ZONE12 12
#define ZONE13 13
#define ZONE14 14
#define ZONE15 15
#define ZONE16 16
#define ZONE17 17
#define ZONE18 18
#define ZONE19 19
#define ZONE20 20
#define ZONE21 21
#define ZONE22 22
#define ZONE23 23
#define ZONE24 24
#define ZONE25 25
#define ZONE26 26
#define ZONE27 27
#define ZONE28 28
#define ZONE29 29
#define ZONE30 30
#define ZONE31 31
#define ZONE32 32
#define ZONE33 33
#define ZONE34 34
#define ZONE35 35
#define ZONE36 36
#define ZONE37 37
#define ZONE38 38
#define ZONE39 39
#define ZONE40 40 
#define ZONE41 41
#define ZONE42 42
#define ZONE43 43
#define ZONE44 44
#define ZONE45 45
#define ZONE46 46
#define ZONE47 47
#define ZONE48 48
#define ZONE49 49
#define ZONE50 50
#define ZONE51 51
#define ZONE52 52
#define ZONE53 53
#define ZONE54 54
#define ZONE55 55
#define ZONE56 56
#define ZONE57 57
#define ZONE58 58
#define ZONE59 59
#define ZONE60 60
#define ZONE61 61
#define ZONE62 62
#define ZONE63 63
#define ZONE64 64
#define MAX_ZONES 65
new zone[MAX_ZONES]; 
And i tried the first one here after created it
PHP код:
zone[ZONE0] = GangZoneCreate(1994.33, -1100.822056.86, -920.815);
    
GangZoneShowForAll(ZONE0COLOR_RED);
    
zone[ZONE1] = GangZoneCreate(2056.86, -1126.322126.86, -920.815);
    
zone[ZONE2] = GangZoneCreate(2185.33, -1154.592281.45, -934.489);
    
zone[ZONE3] = GangZoneCreate(2126.86, -1126.322185.33, -934.489);
    
zone[ZONE63] = GangZoneCreate(2421.03, -1628.532632.83, -1454.35);
    
zone[ZONE4] = GangZoneCreate(2222.56, -1628.532421.03, -1494.03);
    
zone[ZONE5] = GangZoneCreate(2266.26, -1494.032381.68, -1372.04);
    
zone[ZONE6] = GangZoneCreate(2381.68, -1494.032421.03, -1454.35);
    
zone[ZONE7] = GangZoneCreate(2281.45, -1372.042381.68, -1135.04);
    
zone[ZONE8] = GangZoneCreate(2381.68, -1454.352462.13, -1135.04);
    
zone[ZONE9] = GangZoneCreate(2462.13, -1454.352581.73, -1135.04);
    
zone[ZONE10] = GangZoneCreate(2056.86, -1449.672266.21, -1372.04);
    
zone[ZONE11] = GangZoneCreate(1996.91, -1449.672056.86, -1350.72);
    
zone[ZONE12] = GangZoneCreate(2124.66, -1494.032266.21, -1449.67);
    
zone[ZONE13] = GangZoneCreate(2056.86, -1372.042281.45, -1210.74);
    
zone[ZONE14] = GangZoneCreate(2056.86, -1210.742185.33, -1126.32);
    
zone[ZONE15] = GangZoneCreate(2185.33, -1210.742281.45, -1154.59);
    
zone[ZONE16] = GangZoneCreate(1812.62, -1350.722056.86, -1100.82);
    
zone[ZONE17] = GangZoneCreate(1812.62, -1449.671996.91, -1350.72);
    
zone[ZONE18] = GangZoneCreate(1812.62, -1100.821994.33, -973.38);
    
zone[ZONE19] = GangZoneCreate(1971.66, -1852.872222.56, -1742.31);
    
zone[ZONE20] = GangZoneCreate(1812.62, -1852.871971.66, -1742.31);
    
zone[ZONE21] = GangZoneCreate(1812.62, -1742.311951.66, -1602.31);
    
zone[ZONE22] = GangZoneCreate(1951.66, -1742.312124.66, -1602.31);
    
zone[ZONE23] = GangZoneCreate(1812.62, -1602.312124.66, -1449.67);
    
zone[ZONE24] = GangZoneCreate(2124.66, -1742.312222.56, -1494.03);
    
zone[ZONE25] = GangZoneCreate(1970.62, -2179.252089.0, -1852.87);
    
zone[ZONE26] = GangZoneCreate(2089.0, -2235.842201.82, -1989.9);
    
zone[ZONE27] = GangZoneCreate(2089.0, -1989.92324.0, -1852.87);
    
zone[ZONE28] = GangZoneCreate(2201.82, -2095.02324.0, -1989.9);
    
zone[ZONE29] = GangZoneCreate(2703.58, -2126.92959.35, -1852.87);
    
zone[ZONE30] = GangZoneCreate(-464.5152217.68, -208.572580.36);
    
zone[ZONE31] = GangZoneCreate(-208.572123.01114.0332337.18);
    
zone[ZONE32] = GangZoneCreate(-208.572337.188.429992487.18);
    
zone[ZONE33] = GangZoneCreate(1692.62, -2179.251812.62, -1842.27);
    
zone[ZONE34] = GangZoneCreate(2222.56, -1852.872632.83, -1722.33);
    
zone[ZONE35] = GangZoneCreate(2222.56, -1722.332632.83, -1628.53);
    
zone[ZONE36] = GangZoneCreate(342.648, -2173.29647.712, -1684.65);
    
zone[ZONE37] = GangZoneCreate(72.6481, -2173.29342.648, -1684.65);
    
zone[ZONE38] = GangZoneCreate(1161.52, -1722.261323.9, -1577.59);
    
zone[ZONE39] = GangZoneCreate(1046.15, -1722.261161.52, -1577.59);
    
zone[ZONE40] = GangZoneCreate(851.449, -1804.211046.15, -1577.59);
    
zone[ZONE41] = GangZoneCreate(930.221, -2006.781073.22, -1804.21);
    
zone[ZONE42] = GangZoneCreate(787.461, -1310.21952.663, -1130.84);
    
zone[ZONE43] = GangZoneCreate(787.461, -1130.84952.604, -954.662);
    
zone[ZONE44] = GangZoneCreate(647.557, -1227.28787.461, -1118.28);
    
zone[ZONE45] = GangZoneCreate(647.712, -1416.25787.461, -1227.28);
    
zone[ZONE46] = GangZoneCreate(952.663, -1130.841096.47, -937.184);
    
zone[ZONE47] = GangZoneCreate(1096.47, -1130.841252.33, -1026.33);
    
zone[ZONE48] = GangZoneCreate(1096.47, -1026.331252.33, -910.17);
    
zone[ZONE49] = GangZoneCreate(-2533.041358.9, -1996.661501.21);
    
zone[ZONE50] = GangZoneCreate(-1996.661358.9, -1524.241592.51);
    
zone[ZONE51] = GangZoneCreate(-1982.321274.26, -1524.241358.9);
    
zone[ZONE52] = GangZoneCreate(-2741.071268.41, -2533.041490.47);
    
zone[ZONE53] = GangZoneCreate(-2274.17744.17, -1982.321358.9);
    
zone[ZONE54] = GangZoneCreate(-2274.17578.396, -2078.67744.17);
    
zone[ZONE55] = GangZoneCreate(-2329.31458.411, -1993.28578.396);
    
zone[ZONE56] = GangZoneCreate(-2411.22265.243, -1993.28373.539);
    
zone[ZONE57] = GangZoneCreate(-2253.54373.539, -1993.28458.411);
    
zone[ZONE58] = GangZoneCreate(-2411.22, -222.589, -2173.04265.243);
    
zone[ZONE59] = GangZoneCreate(-2270.04, -324.114, -1794.92, -222.589);
    
zone[ZONE60] = GangZoneCreate(-2173.04, -222.589, -1794.92265.243);
    
zone[ZONE61] = GangZoneCreate(-1794.92249.904, -1242.98578.396);
    
zone[ZONE62] = GangZoneCreate(-1794.92, -50.0963, -1499.89249.904); 
It didn't show then under OnPlayerDeath
PHP код:
    for(new iMAX_ZONES;i++)
    {
    if(
IsPlayerInRangeOfPoint(playerid5.0i) && IsPlayerInRangeOfPoint(killerid5.0i) && gTeam[killerid] != gTeam[playerid])
    {
    
GangZoneShowForAll(i,GetTeamColor(killerid));
    
SendClientMessage(killeridCOLOR_BLUE"You had taken this base !");
    
GivePlayerMoney(killerid1000);
    return 
1;
    }
    } 
PHP код:
stock GetTeamColor(teamid)
{
    switch(
teamid)
    {
        case 
GANG_GROVES: return 0x83F52C80;
        case 
GANG_BALLAS: return 0xE0427F80;
        case 
GANG_VAGOS: return 0xFFCC1180;
        case 
GANG_AZTECAS: return 0x98F5FF80;
        case 
GANG_TRIADS: return 0xD0209080;
        case 
GANG_RIFAS: return 0x87CEFF80;
        case 
GANG_DA_NANG_BOYS: return 0xCD5B4580;
        case 
GANG_RUSSIAN_MAFIAS: return 0xEEDC8280;
        case 
GANG_BIKER: return 0x584E5680;
    }
    return -
1;

But when i kill a player in the zone nothing happend and my team not equal his team !
Please Help !!
REP++
Reply
#2

PHP код:
new bool:help[MAX_PLAYERS];
new 
bool:helped[MAX_PLAYERS];
enum rep
{
    
help
};
new 
info[MAX_PLAYERS][rep];
stock help(nezo)
{
help[playerid] == true;
helped[nezo] == true;
SendClientMessage(playerid, -1"Thank you for helping");
info[playerid][help]++;
return 
1;
}
forward OnPlayerHelp(playeridnezo);
public 
OnPlayerHelp(playeridnezo);
{
if(
help[playerid] == false && helped[nezo] == false) return SendClientMessage(playerid, -1"Please Help I'll rep");
help(nezo);
return 
1;

Reply
#3

Wrong use of IsPlayerInRangeOfPoint - where is x, y and z coordinates? Also error is here

Код:
GangZoneShowForAll(i,GetTeamColor(killerid));
ID of zone isn't i, but zone[i]
Reply
#4

I made a loop for all zones so i = any zone,
Correct me if i am wrong.
Reply
#5

bmub -_- !
Reply
#6

Sorry, but you are wrong. At first, look at your function IsPlayerInRangeOfPoint - something is missing. What? Coordinates. Second issue, zoneid is wrong. I wrote that in previous post, but you changed nothing and you aren't listen my comments. Change things I mentioned and if this won't work write again but give actually code.
Reply
#7

So i should take the cordinates of the 65 zone and put them in IsPlayerInRangeOfPoint
like
PHP код:
if(IsPlayerInRangeOfPoint(playeridxy|| playeridxy//etc. 
??
Reply
#8

Yes, but this is "old method", there is better way to do it. On my server I have gangzones, too. I recommend using streamer for gangzones and operate on callback OnPlayerEnterDynamicArea. Also this code

Код:
zone[ZONE0] = GangZoneCreate(1994.33, -1100.82, 2056.86, -920.815); 
    zone[ZONE1] = GangZoneCreate(2056.86, -1126.32, 2126.86, -920.815); 
    zone[ZONE2] = GangZoneCreate(2185.33, -1154.59, 2281.45, -934.489); 
    zone[ZONE3] = GangZoneCreate(2126.86, -1126.32, 2185.33, -934.489); 
    zone[ZONE63] = GangZoneCreate(2421.03, -1628.53, 2632.83, -1454.35); 
    zone[ZONE4] = GangZoneCreate(2222.56, -1628.53, 2421.03, -1494.03); 
    zone[ZONE5] = GangZoneCreate(2266.26, -1494.03, 2381.68, -1372.04); 
    zone[ZONE6] = GangZoneCreate(2381.68, -1494.03, 2421.03, -1454.35); 
    zone[ZONE7] = GangZoneCreate(2281.45, -1372.04, 2381.68, -1135.04); 
    zone[ZONE8] = GangZoneCreate(2381.68, -1454.35, 2462.13, -1135.04); 
    zone[ZONE9] = GangZoneCreate(2462.13, -1454.35, 2581.73, -1135.04); 
    zone[ZONE10] = GangZoneCreate(2056.86, -1449.67, 2266.21, -1372.04); 
    zone[ZONE11] = GangZoneCreate(1996.91, -1449.67, 2056.86, -1350.72); 
    zone[ZONE12] = GangZoneCreate(2124.66, -1494.03, 2266.21, -1449.67); 
    zone[ZONE13] = GangZoneCreate(2056.86, -1372.04, 2281.45, -1210.74); 
    zone[ZONE14] = GangZoneCreate(2056.86, -1210.74, 2185.33, -1126.32); 
    zone[ZONE15] = GangZoneCreate(2185.33, -1210.74, 2281.45, -1154.59); 
    zone[ZONE16] = GangZoneCreate(1812.62, -1350.72, 2056.86, -1100.82); 
    zone[ZONE17] = GangZoneCreate(1812.62, -1449.67, 1996.91, -1350.72); 
    zone[ZONE18] = GangZoneCreate(1812.62, -1100.82, 1994.33, -973.38); 
    zone[ZONE19] = GangZoneCreate(1971.66, -1852.87, 2222.56, -1742.31); 
    zone[ZONE20] = GangZoneCreate(1812.62, -1852.87, 1971.66, -1742.31); 
    zone[ZONE21] = GangZoneCreate(1812.62, -1742.31, 1951.66, -1602.31); 
    zone[ZONE22] = GangZoneCreate(1951.66, -1742.31, 2124.66, -1602.31); 
    zone[ZONE23] = GangZoneCreate(1812.62, -1602.31, 2124.66, -1449.67); 
    zone[ZONE24] = GangZoneCreate(2124.66, -1742.31, 2222.56, -1494.03); 
    zone[ZONE25] = GangZoneCreate(1970.62, -2179.25, 2089.0, -1852.87); 
    zone[ZONE26] = GangZoneCreate(2089.0, -2235.84, 2201.82, -1989.9); 
    zone[ZONE27] = GangZoneCreate(2089.0, -1989.9, 2324.0, -1852.87); 
    zone[ZONE28] = GangZoneCreate(2201.82, -2095.0, 2324.0, -1989.9); 
    zone[ZONE29] = GangZoneCreate(2703.58, -2126.9, 2959.35, -1852.87); 
    zone[ZONE30] = GangZoneCreate(-464.515, 2217.68, -208.57, 2580.36); 
    zone[ZONE31] = GangZoneCreate(-208.57, 2123.01, 114.033, 2337.18); 
    zone[ZONE32] = GangZoneCreate(-208.57, 2337.18, 8.42999, 2487.18); 
    zone[ZONE33] = GangZoneCreate(1692.62, -2179.25, 1812.62, -1842.27); 
    zone[ZONE34] = GangZoneCreate(2222.56, -1852.87, 2632.83, -1722.33); 
    zone[ZONE35] = GangZoneCreate(2222.56, -1722.33, 2632.83, -1628.53); 
    zone[ZONE36] = GangZoneCreate(342.648, -2173.29, 647.712, -1684.65); 
    zone[ZONE37] = GangZoneCreate(72.6481, -2173.29, 342.648, -1684.65); 
    zone[ZONE38] = GangZoneCreate(1161.52, -1722.26, 1323.9, -1577.59); 
    zone[ZONE39] = GangZoneCreate(1046.15, -1722.26, 1161.52, -1577.59); 
    zone[ZONE40] = GangZoneCreate(851.449, -1804.21, 1046.15, -1577.59); 
    zone[ZONE41] = GangZoneCreate(930.221, -2006.78, 1073.22, -1804.21); 
    zone[ZONE42] = GangZoneCreate(787.461, -1310.21, 952.663, -1130.84); 
    zone[ZONE43] = GangZoneCreate(787.461, -1130.84, 952.604, -954.662); 
    zone[ZONE44] = GangZoneCreate(647.557, -1227.28, 787.461, -1118.28); 
    zone[ZONE45] = GangZoneCreate(647.712, -1416.25, 787.461, -1227.28); 
    zone[ZONE46] = GangZoneCreate(952.663, -1130.84, 1096.47, -937.184); 
    zone[ZONE47] = GangZoneCreate(1096.47, -1130.84, 1252.33, -1026.33); 
    zone[ZONE48] = GangZoneCreate(1096.47, -1026.33, 1252.33, -910.17); 
    zone[ZONE49] = GangZoneCreate(-2533.04, 1358.9, -1996.66, 1501.21); 
    zone[ZONE50] = GangZoneCreate(-1996.66, 1358.9, -1524.24, 1592.51); 
    zone[ZONE51] = GangZoneCreate(-1982.32, 1274.26, -1524.24, 1358.9); 
    zone[ZONE52] = GangZoneCreate(-2741.07, 1268.41, -2533.04, 1490.47); 
    zone[ZONE53] = GangZoneCreate(-2274.17, 744.17, -1982.32, 1358.9); 
    zone[ZONE54] = GangZoneCreate(-2274.17, 578.396, -2078.67, 744.17); 
    zone[ZONE55] = GangZoneCreate(-2329.31, 458.411, -1993.28, 578.396); 
    zone[ZONE56] = GangZoneCreate(-2411.22, 265.243, -1993.28, 373.539); 
    zone[ZONE57] = GangZoneCreate(-2253.54, 373.539, -1993.28, 458.411); 
    zone[ZONE58] = GangZoneCreate(-2411.22, -222.589, -2173.04, 265.243); 
    zone[ZONE59] = GangZoneCreate(-2270.04, -324.114, -1794.92, -222.589); 
    zone[ZONE60] = GangZoneCreate(-2173.04, -222.589, -1794.92, 265.243); 
    zone[ZONE61] = GangZoneCreate(-1794.92, 249.904, -1242.98, 578.396); 
    zone[ZONE62] = GangZoneCreate(-1794.92, -50.0963, -1499.89, 249.904);
I don't know why the hell here is GangZoneShowForAll function, but I am not about that. For what here is variable for all zones? These zones isn't dynamic, so you can do something like this

Код:
new theZone[2];

//CREATING ZONES
theZone[0] = GangZoneCreate(1994.33, -1100.82, 2056.86, -920.815); //first zone
GangZoneCreate(2056.86, -1126.32, 2126.86, -920.815); //and next zones
...
...
theZone[1] = GangZoneCreate(2421.03, -1628.53, 2632.83, -1454.35); //the last one
And all zones is between theZone[0] and theZone[1], if you want show all zones for player

Код:
for(new zoneid = theZone[0]; zoneid <= theZone[1]; zoneid++)
{
GangZoneShowForPlayer(playerid, zoneid, color);
}
This method can be also used for vehicles, checkpoints and more things. Of course only if something isn't created dynamic in game by command. But this for more advanced scripters and you don't need this.
Reply
#9

Sorry can you explain more i will rep you .
Reply
#10

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
So i should take the cordinates of the 65 zone and put them in IsPlayerInRangeOfPoint
like
PHP код:
if(IsPlayerInRangeOfPoint(playeridxy|| playeridxy//etc. 
??
Yes, That's why the code isn't working, https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)