[duvida] portao hq
#1

to criando um comando pra abrir o portao da hq e qndo sair fechar neh , mas so q ta dando erro.


criei uma:
pawn Code:
new PortaoHit
depois uma forward
pawn Code:
forward PortaoHit2
Depois crio o objeto na ongamemodinit
pawn Code:
PortaoHit = CreateObject(980,1286.0999755859,-1653.5,15.300000190735,0.00000000,0.00000000,89.25000000); //portao hitman
depois vou na public onplayercommandtext
pawn Code:
if(strcmp(cmd, "/phit", true) == 0)
    {
        if ((PlayerInfo[playerid][pMembro] == 8 || PlayerInfo[playerid][pLider] == 8) && PlayerToPoint(15.0, playerid, 1286.0999755859,-1653.5,15.300000190735))
        {
            F_MoveObject( PortaoHit, 1286.0999755859,-1653.5,15.300000190735,3);
            GameTextForPlayer(playerid, "~w~Portao Hitman ~n~~b~Aberto!", 3000, 2);
            SetTimer("PortaoHit2", 3000, false);
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "*** Vocк nao esta perto do portao ou nao e Hitman ***");
        }
        return 1;
    }
ai eu crio uma public pra forward funfar
[pawn]public PortaoHit2() {
F_MoveObject(PortaoHit2, 1286.0999755859,-1653.5,15.300000190735, 2);//Portao X1 Closed
return 1;
}


quando eu compilo da esses erros
pawn Code:
C:\Users\Kinho\Desktop\My Server\gamemodes\Brasil Best Server.pwn(43919) : error 076: syntax error in the expression, or invalid function call
Linha 43919
pawn Code:
F_MoveObject(PortaoHit2, 1286.0999755859,-1653.5,15.300000190735, 2);//Portao X1 Closed
Alguem sabe o q esta acontecendo, o que to fazendo de errado ?
Reply
#2

mano, usa a search, tem vбrios tutoriais de como criar portхes automбticos, eletrфnicos e etc =)
Reply
#3

para mover um objecto vc precisa cria-lo 1° cade o objeto do PortaoHit2 ? eu acredito q vc queria fazer isto.

pawn Code:
F_MoveObject(PortaoHit, 1286.0999755859,-1653.5,15.300000190735, 2);//Portao X1 Closed
Reply
#4

Valeu paulor eu tava colocando assim


pawn Code:
public PortaoHit2() {
F_MoveObject(PortaoHit2, 1286.0999755859,-1653.5,15.300000190735, 2);//Portao X1 Closed
return 1;
}
mas era assim

pawn Code:
public PortaoHit2() {
F_MoveObject(PortaoHit, 1286.0999755859,-1653.5,15.300000190735, 2);//Portao X1 Closed
return 1;
}
Valeu aew se funfar aki ganha meu rep
Reply
#5

blz. й pra funfar
Reply
#6

Funfo ganhou meu rep
Reply
#7

so me diz uma coisa como fasso pra colocar uma GameTextForPlayer quando o portгo for fechado ?

pawn Code:
if(strcmp(cmd, "/phit", true) == 0)
    {
        if ((PlayerInfo[playerid][pMembro] == 8 || PlayerInfo[playerid][pLider] == 8) && PlayerToPoint(15.0, playerid, 1286.0999755859,-1653.5,15.300000190735))
        {
            F_MoveObject( PortaoHit, 1286.0999755859,-1641.5,15.300000190735,3);
            GameTextForPlayer(playerid, "~w~Portao Hitman ~n~~b~Aberto!", 5000, 3);
            SetTimer("PortaoHit2", 6000, false);
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "*** Vocк nao esta perto do portao ou nao e Hitman ***");
        }
        return 1;
    }
Reply
#8

Coloca na public PortaoHit2 o GameTextForPlayer.
Reply
#9

ok Valeu
Reply
#10

Nds.
Reply
#11

function createTheGate ()

myGate1 = createObject ( 980, 2313.3000488281, --1216.0999755859, 25.60000038147, 0, 0, 0 )


end

addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate )





function openMyGate ( )
moveObject ( myGate1, 2500, 2313.3000488281, -1216.0999755859, 28.89999961853 )
end
addCommandHandler("abrir",openMyGate)


function movingMyGateBack ()
moveObject ( myGate1, 2500, 2313.3000488281, --1216.0999755859, 25.60000038147 )
end
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)