Error en OnPlayerEnterDynamicArea :C
#1

El problema es el siguiente:
Al entrar a la Zona de Stunt me sale "Zona ~n~~n~___________Stunt" que es el textdraw, todo bien alli, pero al entrar a otra zona como la de Drift me sale "Zona ~n~~n~___________Stunt" en ves la del Drift, sea la zona q estй solo me sale la primera, la del Stunt, que hago mal :C


PHP код:
public OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == ZonaStunts1 || Zona1Stunts1)
    {
      
PlayerTextDrawColor(playerid,MiZona[playerid], 65535);
      
PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Stunt");
      
PlayerTextDrawShow(playeridMiZona[playerid]);
      
ResetPlayerWeapons(playerid);
      
GivePlayerWeapon(playerid,1,1);
      return 
1;
    }
    
    else if(
areaid == ZonaDrift1 || Zona1Drift1 || Zona2Drift1)
    {
      
PlayerTextDrawColor(playerid,MiZona[playerid], 0xFFFF00FF);
      
PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Drift");
      
PlayerTextDrawShow(playeridMiZona[playerid]);
      
ResetPlayerWeapons(playerid);
      
GivePlayerWeapon(playerid,1,1);
      return 
1;
    }
    
    else if(
areaid == ZonaDesmadre1 || Zona1Desmadre1)
    {
      
PlayerTextDrawColor(playerid,MiZona[playerid], 0xFF0000FF);
      
PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Mortal");
      
PlayerTextDrawShow(playeridMiZona[playerid]);
      
ResetPlayerWeapons(playerid);
      
GivePlayerWeapon(playerid,38,900);
      
GivePlayerWeapon(playerid,35,100);
      
GivePlayerWeapon(playerid,16,100);
      
GivePlayerWeapon(playerid,24,900);
      
GivePlayerWeapon(playerid,32,900);
      
GivePlayerWeapon(playerid,1,1);
      return 
1;
    }
    return 
1;
}
    
public 
OnPlayerLeaveDynamicArea(playeridareaid)
{
      if(
areaid == ZonaStunts1 || Zona1Stunts1 || ZonaDrift1 || Zona1Drift1 || Zona2Drift1)
      {
        
PlayerTextDrawHide(playeridMiZona[playerid]);
        
GivePlayerWeapon(playerid,22,300);
        
GivePlayerWeapon(playerid,25,300);
        
GivePlayerWeapon(playerid,30,300);
        
GivePlayerWeapon(playerid,32,300);
        
GivePlayerWeapon(playerid,41,500);
        
GivePlayerWeapon(playerid,4,1);
        
GivePlayerWeapon(playerid,15,1);
        
GivePlayerWeapon(playerid,1,1);
        return 
1;
      }
      
      else if(
areaid == ZonaDesmadre1 || Zona1Desmadre1)
      {
        
PlayerTextDrawHide(playeridMiZona[playerid]);
        
ResetPlayerWeapons(playerid);
        
SetPlayerRandomArms(playerid);
        return 
1;
      }
    return 
1;

Reply
#2

Prueba
pawn Код:
PlayerTextDrawHide(playerid, MiZona[playerid]);
Y despues entonces pones el
pawn Код:
PlayerTextDrawShow(playerid, MiZona[playerid]);
Reply
#3

Quote:
Originally Posted by Onfroi
Посмотреть сообщение
Prueba
pawn Код:
PlayerTextDrawHide(playerid, MiZona[playerid]);
Y despues entonces pones el
pawn Код:
PlayerTextDrawShow(playerid, MiZona[playerid]);
Serнa lo mismo, al salir de la zona borra la texdraw con PlayerTextDrawHide(playerid, MiZona[playerid]);

Ademбs si entro primero x ejemplo al de Drift me sale la del Stunt y no solo la textdraw si no todas las funciones q hay en la primera..

Quote:
Originally Posted by dannypanda05
Посмотреть сообщение
Serнa lo mismo, al salir de la zona borra la texdraw con PlayerTextDrawHide(playerid, MiZona[playerid]);

Ademбs si entro primero x ejemplo al de Drift me sale la del Stunt y no solo la textdraw si no todas las funciones q hay en la primera..
Reitero: alguien q me diga x q estб asi?, necesito esto
Reply
#4

Posiblemente por las condicionales, aunque no creo que sea el problema... ...siempre es bueno intentar.

Ъsalo asн:


pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    switch(areaid)
    {
        case ZonaStunts1, Zona1Stunts1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 65535);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Stunt");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDrift1, Zona1Drift1, Zona2Drift1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 0xFFFF00FF);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Drift");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDesmadre1, Zona1Desmadre1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 0xFF0000FF);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Mortal");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,38,900);
            GivePlayerWeapon(playerid,35,100);
            GivePlayerWeapon(playerid,16,100);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,32,900);
            GivePlayerWeapon(playerid,1,1);
        }
    }
    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    switch(areaid)
    {
        case ZonaStunts1, Zona1Stunts1, ZonaDrift1, Zona1Drift1 Zona2Drift1)
        {
            PlayerTextDrawHide(playerid, MiZona[playerid]);
            GivePlayerWeapon(playerid,22,300);
            GivePlayerWeapon(playerid,25,300);
            GivePlayerWeapon(playerid,30,300);
            GivePlayerWeapon(playerid,32,300);
            GivePlayerWeapon(playerid,41,500);
            GivePlayerWeapon(playerid,4,1);
            GivePlayerWeapon(playerid,15,1);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDesmadre1, Zona1Desmadre1:
        {
            PlayerTextDrawHide(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            SetPlayerRandomArms(playerid);
        }
    }
    return 1;
}
Reply
#5

else if(areaid == ZonaDrift1 || Zona1Drift1 || Zona2Drift1)

Esto estб totalmente incorrecto. Utiliza:
else if(areaid == ZonaDrift1 || areaid == Zona1Drift1 || areaid == Zona2Drift1)
Reply
#6

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
Posiblemente por las condicionales, aunque no creo que sea el problema... ...siempre es bueno intentar.

Ъsalo asн:


pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    switch(areaid)
    {
        case ZonaStunts1, Zona1Stunts1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 65535);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Stunt");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDrift1, Zona1Drift1, Zona2Drift1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 0xFFFF00FF);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Drift");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDesmadre1, Zona1Desmadre1:
        {
            PlayerTextDrawColor(playerid,MiZona[playerid], 0xFF0000FF);
            PlayerTextDrawSetString(playerid,MiZona[playerid],"Zona ~n~~n~___________Mortal");
            PlayerTextDrawShow(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,38,900);
            GivePlayerWeapon(playerid,35,100);
            GivePlayerWeapon(playerid,16,100);
            GivePlayerWeapon(playerid,24,900);
            GivePlayerWeapon(playerid,32,900);
            GivePlayerWeapon(playerid,1,1);
        }
    }
    return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    switch(areaid)
    {
        case ZonaStunts1, Zona1Stunts1, ZonaDrift1, Zona1Drift1 Zona2Drift1)
        {
            PlayerTextDrawHide(playerid, MiZona[playerid]);
            GivePlayerWeapon(playerid,22,300);
            GivePlayerWeapon(playerid,25,300);
            GivePlayerWeapon(playerid,30,300);
            GivePlayerWeapon(playerid,32,300);
            GivePlayerWeapon(playerid,41,500);
            GivePlayerWeapon(playerid,4,1);
            GivePlayerWeapon(playerid,15,1);
            GivePlayerWeapon(playerid,1,1);
        }
        case ZonaDesmadre1, Zona1Desmadre1:
        {
            PlayerTextDrawHide(playerid, MiZona[playerid]);
            ResetPlayerWeapons(playerid);
            SetPlayerRandomArms(playerid);
        }
    }
    return 1;
}
No wey, sale errores, igual dudo q sea eso pero igual gracias x ayudar C:


Quote:
Originally Posted by admantis
Посмотреть сообщение
else if(areaid == ZonaDrift1 || Zona1Drift1 || Zona2Drift1)

Esto estб totalmente incorrecto. Utiliza:
else if(areaid == ZonaDrift1 || areaid == Zona1Drift1 || areaid == Zona2Drift1)
Siii, asi era D: funcionу, gracias wey, me ayudastes mucho con esto =)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)