09.04.2013, 22:27
To passando uma dor de cabeзa com essa bosta.
OngameModeInit:
pawn Код:
static cpzone[MAX_PLAYERS][MAX_GANGS+1],lastcp[MAX_PLAYERS]; // getar checkpoint e salvar o ultimo checkpoint em que vocк passou
pawn Код:
new grove,ballas,aztecas,vagos,cpgang2,cpgang3,cpgang4; // declaraзгo dos checkpoints e das gangzones
new GangNames[4][] = // nome das gangs para aparecer 'A gang X doiminou mais um territуrio'
{
"grove",
"ballas",
"vagos"
"aztecas"
};
new pgzcolor[MAX_GANGS+1] = // cores para os plaeyrs
0x006A00FF, 0x004080FF, 0xFF0080FF, 0xFFFF00FF4 // igual
};
new gzcolor[MAX_GANGS+1] = // cores para as gangzones
{
0x006A00FF, 0x004080FF, 0xFF0080FF, 0xFFFF00FF4 // igual
};
OngameModeInit:
pawn Код:
grove = GangZoneCreate(2458.6389,-1895.1144,13.5469,182.3192); // cria gangzone para a gang 1
ballas = GangZoneCreate(2458.6389,-1895.1144,13.5469,182.3192); // cria gangzone para a gang 2
vagos = GangZoneCreate(2458.6389,-1895.1144,13.5469,182.3192); // cria gangzone para a gang 3
aztecas = GangZoneCreate(2458.6389,-1895.1144,13.5469,182.3192);
cpgang1 = CPS_AddCheckpoint(2495.0383,-1686.9420,13.5140,2.0,80); // cria checkpoint para gang 1
cpgang2 = CPS_AddCheckpoint(1722.3857,-1607.7697,13.5469,2.0,80); // cria checkpoint para gang 2
cpgang3 = CPS_AddCheckpoint(1976.1494,-1234.6455,20.0469,2.0,80); // cria checkpoint para gang 3
#pragma unused cpgang1,cpgang2,cpgang3,cpgang4 // declaraзгo de nгo uso para nгo dar warning
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
if(lastcp[playerid] > 0 && lastcp[playerid] <= MAX_GANGS+1)
{
cpzone[playerid][lastcp[playerid]] = 0; // quando o player sai do checkpoint a contagem й reiniciada e o dominio й abortado
GangZoneStopFlashForAll(lastcp[playerid]-1);
}
return 1;
}
pawn Код:
public ZoneCheckpointChecker() // callback para checar as gangzones
{
new string[75],tmp[10];
for(new i; i != MAX_PLAYERS; ++i)
{
if(!IsPlayerConnected(i)) continue;
if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= MAX_GANGS+1 && gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
{
if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < ZONE_TIME)
{
cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
format(tmp, sizeof tmp, "~g~%2d/20", cpzone[i][CPS_GetPlayerCheckpoint(i)]);
GameTextForPlayer(i, tmp, 1001, 4);
GangZoneFlashForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
}
else if(cpzone[i][CPS_GetPlayerCheckpoint(i)] == ZONE_TIME)
{
GameTextForPlayer(i, "~r~Area ~w~Conquistada", 4000, 1);
GivePlayerMoney(i,GetPlayerMoney(i) + 100000);
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));
format(string, sizeof(string), "*>> [GANGZONES]: A gang '{00FF00}%s{FFFF00}' dominou mais um territуrio!",GangNames[GetPlayerTeam(i)][0]);
PlayerPlaySound(i, 1058, 0, 0, 0);
SendClientMessageToAll(0xFFFF00AA, " ");
SendClientMessageToAll(0xFFFF00AA, string);
SendClientMessageToAll(0xFFFF00AA, " ");
}
}
}
return 0;
}
pawn Код:
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(63) : error 020: invalid symbol name ""
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(70) : error 001: expected token: "}", but found "-string-"
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(71) : error 010: invalid function or declaration
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(74) : error 020: invalid symbol name ""
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(75) : error 010: invalid function or declaration
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(293) : error 022: must be lvalue (non-constant)
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(294) : error 022: must be lvalue (non-constant)
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(295) : error 022: must be lvalue (non-constant)
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(296) : error 022: must be lvalue (non-constant)
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(298) : error 017: undefined symbol "cpgang1"
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(302) : error 017: undefined symbol "cpgang1"
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(423) : error 012: invalid function call, not a valid address
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(423) : warning 215: expression has no effect
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(423) : error 001: expected token: ";", but found ")"
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(423) : error 029: invalid expression, assumed zero
C:\Users\camila\Desktop\Pastas\Programacгo pawn\gamemodes\Servidor.pwn(423) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
15 Errors.