[Ajuda] Comando Portao
#1

Boa Noite Pessoal!
Intao vamos la fiz uma penitenciaria no meu servidor e resolvi colocar um portao ai fiz os comando tudo e tals mais quando vou testa em in-game nao funciona so aparece a mensagem que deveria aparecer quando o portao abrisse!

pawn Code:
new PortaoPeni;
pawn Code:
forward ClosedPortaoPeni(gateid);
pawn Code:
//Portao Penitenciaria
PortaoPeni = CreateDynamicObject(980,666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000);
pawn Code:
if(strcmp(cmd, "/ppeni", true) == 0)
    {
        if ((IsACop(playerid)) && PlayerToPoint(7.0, playerid, 666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000))
        {
            MoveObject(PortaoPeni,666.5000000,-2871.3000000,9.4000000,0.0000000,0.0000000,326.0000000,3.0);
            SetTimerEx("ClosedPortaoPeni", 10000, false, "i", PortaoPeni);
            SendClientMessage(playerid, COLOR_YELLOW, "Portao Penitenciaria Aberto");
            return 1;
        }
    }
pawn Code:
public ClosedPortaoPeni(gateid)
{
    if(gateid == PortaoPeni)
    {
        MoveObject(PortaoPeni,666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000,3.0);
    }
return 1;
}

Aaaa e tambem surgiu 3 warnnings!!!

pawn Code:
C:\Users\Vitor\Desktop\GM\gamemodes\BKC.pwn(38418) : warning 202: number of arguments does not match definition
C:\Users\Vitor\Desktop\GM\gamemodes\BKC.pwn(38418) : warning 202: number of arguments does not match definition
C:\Users\Vitor\Desktop\GM\gamemodes\BKC.pwn(38418) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:          12076 bytes
Code size:          2343428 bytes
Data size:          8622348 bytes
Stack/heap size:      16384 bytes; estimated max. usage=7438 cells (29752 bytes)
Total requirements:10994236 bytes

3 Warnings.
Linha 38418
pawn Code:
if ((IsACop(playerid)) && PlayerToPoint(7.0, playerid, 666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000))
Me Ajudem Pessoal oq tem de errado?
Reply
#2

Vocк criou um objeto dinвmico e quer move-lo como objeto normal. Mude para MoveDynamicObject.

O que "PlayerToPoint" retorna?

Tente:
PHP Code:
if (IsACop(playerid)  && PlayerToPoint(7.0playerid666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000)) 
Reply
#3

Quote:
Originally Posted by DarkBr
View Post
Vocк criou um objeto dinвmico e quer move-lo como objeto normal. Mude para MoveDynamicObject.

O que "PlayerToPoint" retorna?

Tente:
PHP Code:
if (IsACop(playerid)  && PlayerToPoint(7.0playerid666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000)) 
Coloquei la mais nada aconteceu!!
Mudei tbm o MoveDynamicObject o portao nao aparece no jogo
Reply
#4

Estou meio cansado mas ver ai se estб certo.

PHP Code:
//Acredito que o "CreateDynamicObject" nгo atrapalhe. Mas testa ae
PortaoPeni CreateObject(980,666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000); 
PHP Code:
if(strcmp(cmd"/ppeni"true)==0)
{                                  
//Й melhor usar IsPlayerInRangeOfPoint nгo ?
    
if(IsACop(playerid) && IsPlayerInRangeOfPoint(playerid7.0666.50000,-2871.30005,14.90000))
    {
        
MoveObject(PortaoPeni,666.50000,-2871.30000,9.40000,3.0);
        
SetTimerEx("ClosedPortaoPeni"10000false"i"playerid); //Use a funзгo playerid
        
SendClientMessage(playeridCOLOR_YELLOW"| INFO | Portao Penitenciaria aberto, fecharб em 10 segundos!");
        return 
1;
    }

PHP Code:
forward ClosedPortaoPeni(playerid);//Use a funзгo playerid
public ClosedPortaoPeni(playerid)
{
    
MoveObject(PortaoPeni,666.5000000,-2871.3000500,14.9000000,3.0);
    return 
1;

@Edit
Reply
#5

Quote:
Originally Posted by CALENZ021
View Post
Estou meio cansado mas ver ai se estб certo.

PHP Code:
//Acredito que o "CreateDynamicObject" nгo atrapalhe. Mas testa ae
PortaoPeni CreateObject(980,666.5000000,-2871.3000500,14.9000000,0.0000000,0.0000000,326.0000000); 
PHP Code:
if(strcmp(cmd"/ppeni"true)==0)
{                                  
//Й melhor usar IsPlayerInRangeOfPoint nгo ?
    
if(IsACop(playerid) && IsPlayerInRangeOfPoint(playerid7.0666.50000,-2871.30005,14.90000))
    {
        
MoveObject(PortaoPeni,666.50000,-2871.30000,9.40000,3.0);
        
SetTimerEx("ClosedPortaoPeni"10000false"i"playerid); //Use a funзгo playerid
        
SendClientMessage(playeridCOLOR_YELLOW"| INFO | Portao Penitenciaria aberto, fecharб em 10 segundos!");
        return 
1;
    }

PHP Code:
forward ClosedPortaoPeni(playerid);//Use a funзгo playerid
public ClosedPortaoPeni(playerid)
{
    
MoveObject(PortaoPeni,666.5000000,-2871.3000500,14.9000000,3.0);
    return 
1;

@Edit
Ufa Mto Obrigado Amigo Deu Certo!
Reply
#6

De nada, se poder da REP +
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)