Need help with some function.
#1

Quote:
public OnPlayerDisconnect(playerid, reason)
{
if(Captured[playerid] == 0; && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
}
return 1;
}

and gets these 4 errors :/

Quote:

C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(111) : error 033: array must be indexed (variable "Captured")
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(111) : error 036: empty statement
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(111) : error 029: invalid expression, assumed zero
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(111) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

i know there's a problem with if(Captured[playerid] == 0; i should remove the ; but if i removed it i will get more errors :/ help please
Reply
#2

pawn Код:
if(Captured[playerid] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1) // removed ';'  idk whether u want 'and' or 'or' if OR
if(Captured[playerid] == 0 || IsPlayerCapturing[playerid][CAPZONE] == 1)
Reply
#3

Код:
if(Captured[playerid] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
is the right code. Show us the errors.
Reply
#4

Give your full scripts and mark the error line
Reply
#5

ah ya, so i made this function for OnPlayerDeath, OnPlayerSpawn, OnPlayerDisconnect
here are the errors:
Quote:

C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(111) : error 033: array must be indexed (variable "Captured")
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(161) : error 033: array must be indexed (variable "Captured")
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(170) : error 033: array must be indexed (variable "Captured")
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(235) : error 055: start of function body without function header
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(236) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(23 : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(244) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(24 : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(252) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(257) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(262) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(264) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(265) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(273) : error 017: undefined symbol "Killtimer"
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(274) : error 033: array must be indexed (variable "CountVar")
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(292) : warning 211: possibly unintended assignment
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(294) : warning 202: number of arguments does not match definition
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(296) : warning 211: possibly unintended assignment
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(29 : warning 202: number of arguments does not match definition
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : error 001: expected token: ";", but found "["
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : error 029: invalid expression, assumed zero
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : error 001: expected token: ";", but found "]"
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(306) : fatal error 107: too many error messages on one line

i removed every ; from the function at OnPlayerDeath, OnPlayerSpawn, OnPlayerDisconnect, and these errors appeared .. P.S every function i used at these cases, is same, there's no different..
Reply
#6

I assume theres something wrong with your variable. let us see were "Captured" is created.
Reply
#7

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
I assume theres something wrong with your variable. let us see were "Captured" is created.
as i told you:

Quote:

public OnPlayerDeath(playerid, killerid, reason)
{
if(Captured[playerid] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
SendClientMessage(playerid, -1, "[ZONE]You have died! You failed to capture the zone!");
}
return 1;
}

public OnPlayerSpawn(playerid)
{
if(Captured[playerid] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
SendClientMessage(playerid, -1, "[ZONE]You have left the capturing Zone!");
}
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
if(Captured[playerid] == 0 && IsPlayerCapturing[playerid][CAPZONE] == 1)
{
LeavingCAPZONE(playerid);
}
return 1;
}

Under "endif"
new Captured[MAX_PLAYERS][30];
Reply
#8

you use new Captured[MAX_PLAYERS][30]; with another range. new Captured[MAX_PLAYERS]; is the right.
Reply
#9

that made the errors 15.. well less atleast, but i got these
Quote:

C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(235) : error 055: start of function body without function header
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(236) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(23 : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(244) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(24 : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(252) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(257) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(262) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(264) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(265) : error 010: invalid function or declaration
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : error 001: expected token: ";", but found "["
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : error 029: invalid expression, assumed zero
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : error 001: expected token: ";", but found "]"
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(271) : fatal error 107: too many error messages on one line

Reply
#10

Oh, some functions were wrong , i have fixed them, now 4 errors only
:
Quote:

C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : error 001: expected token: ";", but found "["
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : error 029: invalid expression, assumed zero
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : warning 215: expression has no effect
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : error 001: expected token: ";", but found "]"
C:\Users\Ultimate\Downloads\samp03x_svr_R2_win32\g amemodes\text.pwn(243) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Line:
Captured[playerid][CAPZONE] = 0;
Reply
#11

Show the whole callback
Reply
#12

Quote:

stock ActiveCAPZONE(playerid)
{
if(UnderAttack[CAPZONE] == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
UnderAttack[CAPZONE] = 1;
timer[playerid][CAPZONE] = SetTimerEx("CAPZONETimer", 30000, false,"i", playerid);
Captured[playerid][CAPZONE] = 0;
SendClientMessage(playerid, -1, "[ZONE]Stay Here for 30 seconds to capture this zone.");
if(gTeam[playerid] = TEAM_ASIA)
{
GangZoneFlashForAll(Zone[CAPZONE], );
}
else if(gTeam[playerid] = TEAM_USA)
{
GangZoneFlashForAll(Zone[CAPZONE], 0x2800FFFF);
}
else if(gTeam[playerid] = NONE)
{
SendClientMessage(playerid, -1, "[ZONE]This zone is not captured by any team! You can capture it");
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
IsPlayerCapturing[i][CAPZONE] = 1;
}
}
else return CaptureZoneMessage(playerid, 1);
}
else return CaptureZoneMessage(playerid, 2);
return 1;
}

that's
Reply
#13

bump :/ ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)