Random Zone bonus
#1

How do i create random zone bonus example i was trying smth but no work ;(
Reply
#2

PHP код:
new Zones[][]
{
   
0.00.00.0,
   
1.11.11.1,
   
2.22.22.2
}

new 
rand;
rand random(sizeof(Zones));
if(
IsPlayerInRangeOfPoint(playerid10.0zones[rand][0], zones[rand][1], zones[rand][2]))
{
     
//your bonus code

Reply
#3

Quote:

new Zones[][]
{
0.0, 0.0, 0.0,
1.1, 1.1, 1.1,
2.2, 2.2, 2.2
}

the correct is:

PHP код:
new Float:Zones[][]
{
   
0.00.00.0,
   
1.11.11.1,
   
2.22.22.2

Reply
#4

Quote:
Originally Posted by moura98
Посмотреть сообщение
the correct is:

PHP код:
new Float:Zones[][]
{
   
0.00.00.0,
   
1.11.11.1,
   
2.22.22.2

Ohh yea I sorry my mistake
Reply
#5

What about this? if i insert this on gm it will work ?

Quote:

#define MAX_WAR 100

new SpecialZone[MAX_WAR];

stock AvailableZone(id)
{
switch(id)
{
case SnakeFarm: return 1;
}
return 0;
}

public SpecialTimer()
{
new i = random(MAX_WAR+1);
new string[128];

if(AvailableZone(i) == 1)
{
if(SpecialZone[i] == 0)
{
format(string, sizeof(string), "* Zone %s is now a bonus zone, Capture it to get a special/additional rewards.", GetZoneName(i));
SendClientMessageToAll(COLOR_PINK, string);

SpecialZone[i] = 1;

print(string);
}
else
{
format(string, sizeof(string), "* Zone %s is no longer a bonus zone, It will be replaced in the next 3 minutes.", GetZoneName(i));
SendClientMessageToAll(COLOR_PINK, string);

SpecialZone[i] = 0;

print(string);
}
}
else
{
SpecialTimer();
}
return 1;
}

Reply
#6

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
Ohh yea I sorry my mistake
don't worry, this is normal
Reply
#7

Quote:
Originally Posted by UltraScripter
Посмотреть сообщение
PHP код:
new Zones[][]
{
   
0.00.00.0,
   
1.11.11.1,
   
2.22.22.2
}
new 
rand;
rand random(sizeof(Zones));
if(
IsPlayerInRangeOfPoint(playerid10.0zones[rand][0], zones[rand][1], zones[rand][2]))
{
     
//your bonus code

Quote:
Originally Posted by moura98
Посмотреть сообщение
the correct is:

PHP код:
new Float:Zones[][]
{
   
0.00.00.0,
   
1.11.11.1,
   
2.22.22.2

It's wrong!
The correct code is:
Код:
new Float:Zones[][] = 
{
   {0.0, 0.0, 0.0},
   {1.1, 1.1, 1.1},
   {2.2, 2.2, 2.2}
};
or

Код:
new Float:Zones[] = 
{
   0.0, 0.0, 0.0,
   1.1, 1.1, 1.1,
   2.2, 2.2, 2.2
};
Reply
#8

This my code above will work ?
Reply
#9

BUMP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)