Erro no OnPlayerEnterCheckpoint
#1

Fala galйra,to com uns problemas no onplayerentercheckpoint,to fazendo o seguinte pra quando o player entrar no checkpoint ele domine a gz e a gangzona fique com a cor do player sу que quando o player entra no checkpoint tipo nгo acontece nada tinha que no caso comeзar a contar uns segundos e depois a gz ficar da cor do player nao acontece nada,isso й erro no OnPlayerEnterCheckpoint ou no ZoneCheckpointChecker??


pawn code
public ZoneCheckpointChecker()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(CPS_GetPlayerCheckpoint(i) > 0 && CPS_GetPlayerCheckpoint(i) <= MAX_GZS+1 &&
gzcolor[CPS_GetPlayerCheckpoint(i)-1] != GetPlayerColor(i))
// se a cor do player for igual da gz a gz nao sera dominada
{
if(cpzone[i][CPS_GetPlayerCheckpoint(i)] < 15)
{
cpzone[i][CPS_GetPlayerCheckpoint(i)]++;
new tmp[11];
format(tmp, sizeof tmp, "~b~%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)] == 15)
{
GivePlayerMoney(i, 200);
GameTextForPlayer(i, "~b~Gang zona dominada!", 4000, 1);
gzcolor[CPS_GetPlayerCheckpoint(i)-1] = GetPlayerColor(i);
GangZoneStopFlashForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneHideForAll(CPS_GetPlayerCheckpoint(i)-1);
GangZoneShowForAll(CPS_GetPlayerCheckpoint(i)-1, GetPlayerColor(i));//a gz fica da cor do player
// que dominou
Reply
#2

Essa funзгo estб sendo executada por um timer?
Reply
#3

Isso , basta o colocar na public "OnPlayerEnterCheckpoint" problema resolvido.
Reply
#4

Sim uso um timer
SetTimer("ZoneCheckpointChecker", 1000, 1);


botei no OnPlayerEnterCheckpoint mas tipo nao domina todas as gzs
no caso sao 10 gangs domina no caso 8 e 2 gangzonas o cara entra no checkpoint
e nao comeзa a contar nao domina a gz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)