02.01.2014, 08:14
(
Последний раз редактировалось Kyance; 02.01.2014 в 09:41.
)
EDIT: Alright, well... I finally understood how pds2k12's version works..
But what do i do inside the case CAPZONE:
Do i do it like
Or..?
Also, do i need to remove all this ->
..?
But what do i do inside the case CAPZONE:
Do i do it like
pawn Код:
while(i < MAX_CAPZONE) // creating a loop, there's 2 way to create a loop, try searching the for(...)
{
switch( tCP[i] )
{
case CAPZONE:
{
if(gTeam[i] == gTeam[playerid])
{
//rest of capture stuff here?D:
}
}
case CAPZONE1:
{
if(gTeam[i] == gTeam[playerid])
{
//rest of capture stuff here?D:
}
}
}
}
Also, do i need to remove all this ->
pawn Код:
stock CAPZONECaptured(playerid)
{
Captured[playerid][CAPZONE] = 1;
UnderAttack[CAPZONE] = 0;
KillTimer(timer[playerid][CAPZONE]);
CountVar[playerid][CAPZONE] = 25;
GivePlayerScore(playerid, 3);
GivePlayerMoney(playerid, 5000);
GameTextForPlayer(playerid, "~g~Captured!~n~~g~+3 ~w~score~n~~w~+5'000~g~$", 3500, 3);
//==========================================================================
for(new i = 0; i < MAX_PLAYERS; i++)
{
IsPlayerCapturing[i][CAPZONE] = 0;
if(gTeam[i] == gTeam[playerid])
{
SendClientMessage(i, 0xFFFFFFFF,"[NOTE] - Your team has captured the train-station! You received +1 score for it!");
GivePlayerScore(i, 1);
}
}
//==========================================================================
tCP[CAPZONE] = gTeam[playerid];
GangZoneStopFlashForAll(Zone[CAPZONE]);
//==========================================================================
if(gTeam[playerid] == USArmy)
{
GangZoneShowForAll(Zone[CAPZONE], US_COLOR);
}
else if(gTeam[playerid] == RussianSpetsnaz)
{
GangZoneShowForAll(Zone[CAPZONE], COLOR_RED);
}
//==========================================================================
new str[128];
format(str, sizeof(str),"* %s has captured the Train-Station!!", GetName(playerid)); //aa
SendClientMessageToAll(COLOR_ORANGE, str);
return 1;
}
stock LeavingCAPZONE(playerid)
{
Captured[playerid][CAPZONE] = 0;
UnderAttack[CAPZONE] = 0;
KillTimer(timer[playerid][CAPZONE]);
CountVar[playerid][CAPZONE] = 25;
GangZoneStopFlashForAll(Zone[CAPZONE]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
IsPlayerCapturing[i][CAPZONE] = 0;
}
SendClientMessage(playerid, COLOR_RED,"[NOTE] - You have failed to capture this zone!");
return 1;
}