SA-MP Forums Archive
Erro no OnPlayerEnterCheckpoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Erro no OnPlayerEnterCheckpoint (/showthread.php?tid=234011)



Erro no OnPlayerEnterCheckpoint - [CSI]DarkSkull_BR - 02.03.2011

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


Re: Erro no OnPlayerEnterCheckpoint - CyNiC - 03.03.2011

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


Re: Erro no OnPlayerEnterCheckpoint - zbt_Daimyo - 03.03.2011

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


Re: Erro no OnPlayerEnterCheckpoint - [CSI]DarkSkull_BR - 05.03.2011

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