[Ajuda] Oque hб de errado?І
#1

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <streamer>

#define MAX_GATES 1

new Gate[MAX_GATES],
    bool:Open[MAX_GATES char];

public OnFilterScriptInit()
{
    Gate[0] = CreateDynamicObject(980,1544.8994140625,-1623.69921875,15.199999809265,0.0,0.0,90);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    switch(PRESSED)
    {
        case KEY_HANDBRAKE:
        {
            if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz)
            {
                switch(Open{0})
                {
                    case true:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} == false;
                    }
                    case false:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} == true;
                    }
                }
            }
    return 1;
}
Код:
C:\Users\Cesar\Desktop\SAMP\pawno\include\streamer.inc(435) : warning 202: number of arguments does not match definition
C:\Users\Cesar\Desktop\SAMP\pawno\include\streamer.inc(449) : warning 202: number of arguments does not match definition
portao.pwn(23) : error 017: undefined symbol "PRESSED"
portao.pwn(27) : error 017: undefined symbol "xxx"
portao.pwn(34) : warning 215: expression has no effect
portao.pwn(39) : warning 215: expression has no effect
portao.pwn(43) : warning 217: loose indentation
portao.pwn(44) : error 002: only a single statement (or expression) can follow each "case"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
================ READY ================
Reply
#2

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <streamer>
#define MAX_GATES 1
new
    Gate[MAX_GATES],
    bool:Open[MAX_GATES char]
    ;
public OnFilterScriptInit()
{
    Gate[0] = CreateDynamicObject(980,1544.8994140625,-1623.69921875,15.199999809265,0.0,0.0,90);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    switch(newkeys)//erro aqui, vc n definiu pressed
    {
        case KEY_HANDBRAKE:
        {
            if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz))//xxx, yyy e zzz devem ser numeros ou variavis q contenham numeros
            {
                switch(Open{0})
                {
                    case true:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = false;
                    }
                    case false:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = true;
                    }
                }
            }
        }
    }//faltava uma }
    return 1;
}
isso deve resolver
Reply
#3

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <streamer>
#define MAX_GATES 1
new
    Gate[MAX_GATES],
    bool:Open[MAX_GATES char]
    ;
public OnFilterScriptInit()
{
    Gate[0] = CreateDynamicObject(980,1544.8994140625,-1623.69921875,15.199999809265,0.0,0.0,90);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    switch(newkeys)//erro aqui, vc n definiu pressed
    {
        case KEY_HANDBRAKE:
        {
            if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz))//xxx, yyy e zzz devem ser numeros ou variavis q contenham numeros
            {
                switch(Open{0})
                {
                    case true:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = false;
                    }
                    case false:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = true;
                    }
                }
            }
        }
    }//faltava uma }
    return 1;
}
isso deve resolver
Foi falta de atenзгo mesmo, mas aqui switch(newkeys)//erro aqui, vc n definiu pressed , poderia me explicar melhor? nгo entendi muito bem
Код:
C:\Users\Cesar\Desktop\SAMP\pawno\include\streamer.inc(435) : warning 202: number of arguments does not match definition
C:\Users\Cesar\Desktop\SAMP\pawno\include\streamer.inc(449) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
@EDIT

Ele funcionou, foi para o lugar certo mas nгo volta, ele sу fica lб
Reply
#4

Aqui tem uma explicaзгo sobre pressed keys

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#5

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Aqui tem uma explicaзгo sobre pressed keys

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Estava lendo minutos atrбs (:
Voltando ao portгo, ele funcionou mas nгo volta para onde estava, e agora?
Acho que errei alguma coordenada..
Reply
#6

Agora vocк terб de fazer um settimer para ele voltar para a posiзгo antiga.
Reply
#7

vocк quer que ele volte quando vocк aperte o botгo novamente?
Reply
#8

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
vocк quer que ele volte quando vocк aperte o botгo novamente?
Nгo, quero que ele volte apуs alguns segundos.


Quote:
Originally Posted by DreeH
Посмотреть сообщение
Agora vocк terб de fazer um settimer para ele voltar para a posiзгo antiga.
E como ficaria o cуdigo? Foi mal, й que nгo entendo tanto de pawn
Reply
#9

Quote:
Originally Posted by ceesar90
Посмотреть сообщение
E como ficaria o cуdigo? Foi mal, й que nгo entendo tanto de pawn
Manda o CODE todo, e manda a coordenada do portгo fechado.
Reply
#10

Quote:
Originally Posted by DreeH
Посмотреть сообщение
Manda o CODE todo, e manda a coordenada do portгo fechado.
pawn Код:
#define FILTERSCRIPT
#define PRESSED(%0)
#include <a_samp>
#include <streamer>
#define MAX_GATES 1
new
    Gate[MAX_GATES],
    bool:Open[MAX_GATES char]
    ;
public OnFilterScriptInit()
{
    Gate[0] = CreateDynamicObject(980,1544.8994140625,-1623.69921875,15.199999809265,0.0,0.0,90);
    return 1;
}

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    switch(newkeys)
    {
        case KEY_HANDBRAKE:
        {
            if(IsPlayerInRangeOfPoint(playerid,10,1544.8994140625,-1623.69921875,15.199999809265))//xxx, yyy e zzz devem ser numeros ou variavis q contenham numeros
            {
                switch(Open{0})
                {
                    case true:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = false;
                    }
                    case false:
                    {
                        MoveDynamicObject(Gate[0],1545.1999511719,-1633.1999511719,15.199999809265,2.0);
                        Open{0} = true;
                    }
                }
            }
        }
    }//faltava uma }
    return 1;
}
Fechado:
pawn Код:
CreateDynamicObject(980,1544.8994140625,-1623.69921875,15.199999809265,0.0,0.0,90);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)