forward ProgressbarTimer(playerid);
new ProgBarTimer;
//Textdraws
zProgBackGround[playerid] = CreatePlayerTextDraw(playerid, 373.974548, 274.499786, "usebox");
PlayerTextDrawLetterSize(playerid, zProgBackGround[playerid], 0.000000, 1.637776);
PlayerTextDrawTextSize(playerid, zProgBackGround[playerid], 256.900024, 0.000000);
PlayerTextDrawAlignment(playerid, zProgBackGround[playerid], 1);
PlayerTextDrawColor(playerid, zProgBackGround[playerid], 0);
PlayerTextDrawUseBox(playerid, zProgBackGround[playerid], true);
PlayerTextDrawBoxColor(playerid, zProgBackGround[playerid], 102);
PlayerTextDrawSetShadow(playerid, zProgBackGround[playerid], 0);
PlayerTextDrawSetOutline(playerid, zProgBackGround[playerid], 0);
PlayerTextDrawFont(playerid, zProgBackGround[playerid], 0);
zProgBar[playerid] = CreatePlayerTextDraw(playerid, 267.099945, 272.089782, " ");
PlayerTextDrawLetterSize(playerid, zProgBar[playerid], 0.657849, 1.917566);
PlayerTextDrawAlignment(playerid, zProgBar[playerid], 1);
PlayerTextDrawColor(playerid, zProgBar[playerid], -5963521);
PlayerTextDrawSetShadow(playerid, zProgBar[playerid], 0);
PlayerTextDrawSetOutline(playerid, zProgBar[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, zProgBar[playerid], 51);
PlayerTextDrawFont(playerid, zProgBar[playerid], 1);
PlayerTextDrawSetProportional(playerid, zProgBar[playerid], 1);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == ZoneCP[TownHall])
{
if(aDuty[playerid] == 1) return SendClientMessage(playerid, -1,"{0080FF}[ Zone ]: {FFFFFF}You cant capture a zone while onduty");
if(TeamCheck[TownHall] == gTeam[playerid]) return SendClientMessage(playerid, -1,"{0080FF}[ Zone ]: {FFFFFF}This zone is already captured by your team");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"ERROR: You cannot capture while in vehicle!");
if(zUnderAttack[TownHall] == 0)
{
zUnderAttack[TownHall] = 1;
IsPlayerCapturing[playerid] = 1;
ZoneTimer[playerid][TownHall] = SetTimerEx("SetZone",25000,false,"i", playerid);
ProgBarTimer = SetTimerEx("ProgressbarTimer",15000,false,"i", playerid);
GangZoneFlashForAll(GangZone[TownHall],GetPlayerColor(playerid));
SendClientMessageToAll(-1, "{0080FF}[ Zone ]: {FFFFFF}Zone TownHall is being taken over");
ZoneDefine[playerid] = TownHall;
}
else return SendClientMessage(playerid, -1,"{0080FF}[ Zone ]: {FFFFFF}This zone is already being taken over!");
}
return 1;
}
public ProgressbarTimer(playerid)
{
if ProgBarTimer == 1000)
(
TextDrawSetString(zProgBar, l);
}
else if ProgBarTimer == 2000)
(
TextDrawSetString(zProgBar, ll);
)
else if ProgBarTimer == 3000)
(
TextDrawSetString(zProgBar, lll);
)
else if ProgBarTimer == 4000)
(
TextDrawSetString(zProgBar, llll);
)
else if ProgBarTimer == 5000)
(
TextDrawSetString(zProgBar, lllll);
)
else if ProgBarTimer == 6000)
(
TextDrawSetString(zProgBar, llllll);
)
else if ProgBarTimer == 7000)
(
TextDrawSetString(zProgBar, lllllll);
)
else if ProgBarTimer == 8000)
(
TextDrawSetString(zProgBar, llllllll);
)
else if ProgBarTimer == 9000)
(
TextDrawSetString(zProgBar, llllllllll);
)
else if ProgBarTimer == 10000)
(
TextDrawSetString(zProgBar, lllllllllll);
)
else if ProgBarTimer == 11000)
(
TextDrawSetString(zProgBar, lllllllllll);
)
else if ProgBarTimer == 12000)
(
TextDrawSetString(zProgBar, llllllllllll);
)
else if ProgBarTimer == 13000)
(
TextDrawSetString(zProgBar, lllllllllllll);
)
else if ProgBarTimer == 14000)
(
TextDrawSetString(zProgBar, llllllllllllll);
)
else if ProgBarTimer == 15000)
(
TextDrawSetString(zProgBar, llllllllllllll);
)
return 1;
}
Atleast explain what is the bug exactly.. I won't go through the whole code and pickup all the bugs.
|
captureTime++;
new captureTime= 0;
public ProgressbarTimer(playerid)
{
captureTime++;
if(captureTime== 1000)
{
TextDrawSetString(zProgBar, l);
}
else if(captureTime== 2000)
{
TextDrawSetString(zProgBar, ll);
}
else if(captureTime== 3000)
{
TextDrawSetString(zProgBar, lll);
}
else if(captureTime== 4000)
{
TextDrawSetString(zProgBar, llll);
}
else if(captureTime == 5000)
{
TextDrawSetString(zProgBar, lllll);
}
else if(captureTime== 6000)
{
TextDrawSetString(zProgBar, llllll);
}
else if(captureTime== 7000)
{
TextDrawSetString(zProgBar, lllllll);
}
else if(captureTime== 8000)
{
TextDrawSetString(zProgBar, llllllll);
}
else if(captureTime== 9000)
{
TextDrawSetString(zProgBar, llllllllll);
}
else if(captureTime== 10000)
{
TextDrawSetString(zProgBar, lllllllllll);
}
else if(captureTime== 11000)
{
TextDrawSetString(zProgBar, lllllllllll);
}
else if(captureTime== 12000)
{
TextDrawSetString(zProgBar, llllllllllll);
}
else if(captureTime== 13000)
{
TextDrawSetString(zProgBar, lllllllllllll);
}
else if(captureTime== 14000)
{
TextDrawSetString(zProgBar, llllllllllllll);
}
else if(captureTime== 15000)
{
TextDrawSetString(zProgBar, llllllllllllll);
//You can delete the other time you have there and just put the code you want to happen here.
}
return 1;
}
ProgBarTimer = SetTimerEx("ProgressbarTimer",15000,false,"i", playerid);
SetTimerEx("ProgressbarTimer",1000,false,"i", playerid);
Ok, You are using it wrong.
1) First create a variable call it lets say: captureTime. 2) Create a 1-second timer and add that same code you have in the ProgressbarTimer timer. 3) Add in the end pawn Код:
pawn Код:
pawn Код:
pawn Код:
E: And also, You have your brackets wrong... I fixed them... Look at the code I provided. |
C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1920) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1924) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1928) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1932) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1936) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1940) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1944) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1948) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1952) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1956) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1960) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1964) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1968) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1972) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(1976) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 15 Errors.
new zProgBar;
new Text:zProgBar;
You have:
PHP код:
PHP код:
|
C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(627) : error 028: invalid subscript (not an array or too many subscripts): "zProgBar" C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(627) : warning 215: expression has no effect C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(627) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(627) : error 029: invalid expression, assumed zero C:\Documents and Settings\Salman\Desktop\GH\SA-MP Servers\WarServer\gamemodes\GWH.pwn(627) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
zProgBar[playerid] = CreatePlayerTextDraw(playerid, 267.099945, 272.089782, "lllllllllllllll"); PlayerTextDrawLetterSize(playerid, zProgBar[playerid], 0.657849, 1.917566); PlayerTextDrawAlignment(playerid, zProgBar[playerid], 1); PlayerTextDrawColor(playerid, zProgBar[playerid], -5963521); PlayerTextDrawSetShadow(playerid, zProgBar[playerid], 0); PlayerTextDrawSetOutline(playerid, zProgBar[playerid], 1); PlayerTextDrawBackgroundColor(playerid, zProgBar[playerid], 51); PlayerTextDrawFont(playerid, zProgBar[playerid], 1); PlayerTextDrawSetProportional(playerid, zProgBar[playerid], 1); |
new ProgBarTimer[MAX_PLAYERS];
ProgBarTimer[playerid] = SetTimerEx("ProgressbarTimer",15000,true,"i", playerid);
new progressTime = 0;
public ProgressbarTimer(playerid)
{
progressTime++;
if(progressTime == 1000)
{
TextDrawSetString(zProgBar, "l");
}
else if(progressTime== 2000)
{
TextDrawSetString(zProgBar, "ll");
}
else if(progressTime == 3000)
{
TextDrawSetString(zProgBar, "lll");
}
else if(progressTime == 4000)
{
TextDrawSetString(zProgBar, "llll");
}
else if(progressTime == 5000)
{
TextDrawSetString(zProgBar, "lllll");
}
else if(progressTime == 6000)
{
TextDrawSetString(zProgBar, "llllll");
}
else if(progressTime == 7000)
{
TextDrawSetString(zProgBar, "llllll");
}
else if(progressTime == 8000)
{
TextDrawSetString(zProgBar, "llllllll");
}
else if(progressTime == 9000)
{
TextDrawSetString(zProgBar, "llllllllll");
}
else if(progressTime == 10000)
{
TextDrawSetString(zProgBar, "lllllllllll");
}
else if(progressTime == 11000)
{
TextDrawSetString(zProgBar, "lllllllllll");
}
else if(progressTime == 12000)
{
TextDrawSetString(zProgBar, "llllllllllll");
}
else if(progressTime == 13000)
{
TextDrawSetString(zProgBar, "lllllllllllll");
}
else if(progressTime == 14000)
{
TextDrawSetString(zProgBar, "llllllllllllll");
}
else if(progressTime == 15000)
{
TextDrawSetString(zProgBar, "llllllllllllll");
KillTimer( ProgBarTimer[playerid] ) ;
}
return 1;
}