[Ajuda] Oque estб errado nesse cуdigo?
#1

criei um portгo e ele simplesmente nгo abre eu queria saber o porque.. Podem me ajudar?
Topo:
pawn Code:
new PoliciaLS;
new PoliciaSF;
new PoliciaLV;
Ongamemodeinit
pawn Code:
SetTimer("APolicia", 1000, true);
    PoliciaLS = CreateDynamicObject(980, 1540.2811,-1627.8862,15.6406,0.0000,0.0000,89.5999);
    PoliciaLV = CreateDynamicObject(969, 2237.5166,2449.4230,9.8725,0.0000,0.0000,90.2999);
    PoliciaSF = CreateDynamicObject(980, -2127.4096,-79.3412,36.9296,0.0000,0.0000,0.0000);
Publics:
pawn Code:
forward APolicia(playerid);
public APolicia(playerid)
{
    if(Stats[playerid][GANGID]!=1)
    {
        if (IsPlayerInRangeOfPoint(playerid, 7.0,1540.2811,-1627.8862,15.6406))
        {
            MoveObject(PoliciaLS,1540.2811,-1627.8862,5.6406, 2.5);
        }
        if (IsPlayerInRangeOfPoint(playerid, 7.0,2237.5166,2449.4230,9.8725))
        {
            MoveObject(PoliciaLV,2237.5166,2449.4230,-0.1274, 2.5);
        }
        if (IsPlayerInRangeOfPoint(playerid, 7.0,-2127.4096,-79.3412,36.9296))
        {
            MoveObject(PoliciaSF,-2127.4096,-79.3412,26.9296, 2.5);
        }
        SetTimer("FPolicia", 10000, true);
    }
}
forward FPolicia();
public FPolicia()
{
        if (IsPlayerInRangeOfPoint(playerid, 7.0,1540.2811,-1627.8862,15.6406))
        {
            MoveObject(PoliciaLS,1540.2811,-1627.8862,15.6406, 2.5);
        }
        if (IsPlayerInRangeOfPoint(playerid, 7.0,2237.5166,2449.4230,9.8725))
        {
            MoveObject(PoliciaLV,2237.5166,2449.4230,9.8725, 2.5);
        }
        if (IsPlayerInRangeOfPoint(playerid, 7.0,-2127.4096,-79.3412,36.9296))
        {
            MoveObject(PoliciaSF,-2127.4096,-79.3412,36.9296, 2.5);
        }
      return 1;
}
Reply
#2

As coordenadas dos portхes abertos,estгo corretos ?
Reply
#3

Sim estб correto
@Edit
Jб tentei resolver de muitas formas... estou tentando criar portхes tem horas xD
Reply
#4

Vocк criou o objeto usando CreateDynamicObject e tб tentando usar MoveObject para mover... Use MoveDynamicObject.
Reply
#5

Funcionou sу que agora o portгo ele meio que abre e antes de abrir ele fecha fica bugado... como se nгo executasse o timer que chama a public FPolicia

@Edit
Entendi o bug se eu ficar perto dele ele fica abrindo e fechando antes de abrir em vez de abrir e esperar eu passar, se eu chegar perto e sair de perto ele funciona normal
@Edit2
Resolvi xD o problema estava bem na minha cara xD Muito obrigado <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)