Capture Zones Problem
#1

Hey all

I have a problem.

SO I have this code:
Код:
forward SetZone(playerid);
public SetZone(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3); //Giving score and money
GivePlayerMoney(playerid, 3000);
SendClientMessage(playerid,GREEN,"Congratulation! You have Gained 3 Scores & 3000$ Money ");
UnderAttack[Zone] = 0; //Stopping the UnderAttack
KillTimer(timer[playerid][Zone]); //Killing the timer
SetGangZone(playerid); //We will define it..
return 1;
}
and I get these errors:
Код:
C:\Users\x\Desktop\x\gamemodes\x.pwn(609) : error 033: array must be indexed (variable "Zone")
C:\Users\x\Desktop\x\gamemodes\x.pwn(610) : error 033: array must be indexed (variable "Zone")
The lines:
609: UnderAttack[Zone] = 0; //Stopping the UnderAttack
610: KillTimer(timer[playerid][Zone]); //Killing the timer

I know how to fix it, but there is no argument for the which zone it is? I hope you guys can understand what I'm trying to say, lol.

For example:

I want to do
Код:
KillTimer(timer[playerid][UEZone]); //Killing the timer
(UEZone is UndeadEnemiesZone)
and the other zones, too.

Here are my variables and defines:
Код:
//Capture Zone Variables
new CP[4];
new Zone[4];
new tCheck[4];
new zDefine[MAX_PLAYERS];
new UnderAttack[4];
new timer[MAX_PLAYERS][4];

//Capture Zone Defines
#define UEZone 0
#define CZone 1
#define BBZone 2
#define PDZone 3
Any help is appreciated, and if you need more code/info, let me know please.
Reply
#2

You need to use [] after your variable Zone, to choose the cell. For example: Zone[UEZone] is cell 0
Reply
#3

It was too complicated, plus too many errors. Just deleted it. Thanks anyways, RedFusion!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)