[Ajuda] Keys
#1

Galera to Sofrendo pra mexer com Keys.

Quero q o Player em um determinado local aperte "Y" e o Objeto Mova.

Codigo:

pawn Код:
//No topo do GM
#define KEY_YES 65536

//public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

if((newkeys == KEY_YES) && (IsPlayerInAnyVehicle(playerid)))
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 3055,-708,11)) return 1;//chamar elevador embaixo
MoveObject(elevador,3028.8000000,-704.5996000,10.5,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,10.5,2.0);
SendClientMessage(playerid,COR_RED, "[INFO] Elevador a Caminho.");
return 1;
}
Porйm quando compilo da Isso:
pawn Код:
C:\Users\user\Desktop\Nova pasta\SERVER\SERVIDOR1\filterscripts\SISTEMAELEVADOR.pwn(5) : warning 201: redefinition of constant/macro (symbol "KEY_YES")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.


//Linha 5:

#define KEY_YES 65536
Alguem saberia me ajudar?
Reply
#2

PHP код:
#define PRESS(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
Ai vocк usa

PHP код:
if(PRESS(KEY_YES)) 
Reply
#3

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
PHP код:
#define PRESS(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
Ai vocк usa

PHP код:
if(PRESSED(KEY_YES)) 
pawn Код:
C:\Users\user\Desktop\Nova pasta\SERVER\SERVIDOR1\filterscripts\ELEVADOR.pwn(475) : error 017: undefined symbol "PRESSED"
C:\Users\user\Desktop\Nova pasta\SERVER\SERVIDOR1\filterscripts\ELEVADOR.pwn(483) : error 017: undefined symbol "PRESSED"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

//linhas

475- if(PRESSED(KEY_YES))
483- if(PRESSED(KEY_YES))
Reply
#4

Subsitutiu

PHP код:
#define KEY_YES 65536 
por
PHP код:
#define PRESS(%0) \ 
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
?
Reply
#5

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
Subsitutiu

PHP код:
#define KEY_YES 65536 
por
PHP код:
#define PRESS(%0) \ 
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) 
?
Sim.

pawn Код:
//Topo FS

#define PRESS(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

// public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

if(PRESSED(KEY_YES))
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 3055,-708,11)) return 1;//chamar elevador embaixo
MoveObject(elevador,3028.8000000,-704.5996000,10.5,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,10.5,2.0);
SendClientMessage(playerid,COR_RED, "[INFO] Elevador a Caminho.");
return 1;
}
if(PRESSED(KEY_YES))
{
if(!IsPlayerInRangeOfPoint(playerid, 7.0, 3040,-712,54.90001525879)) return 1;//chamar elevador em cima
MoveObject(elevador,3028.8000000,-704.5996000,53.799999237061,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,53.799999237061,2.0);
SendClientMessage(playerid,COR_RED, "[INFO] Elevador a Caminho.");
return 1;
}
return 0;
}
Reply
#6

Presta atenзгo nй amigo

PHP код:

#define PRESS(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

// public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)

if(PRESS(KEY_YES))
{
if(!
IsPlayerInRangeOfPoint(playerid7.03055,-708,11)) return 1;//chamar elevador embaixo
MoveObject(elevador,3028.8000000,-704.5996000,10.5,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,10.5,2.0);
SendClientMessage(playerid,COR_RED"[INFO] Elevador a Caminho.");
return 
1;
}
if(
PRESS(KEY_YES))
{
if(!
IsPlayerInRangeOfPoint(playerid7.03040,-712,54.90001525879)) return 1;//chamar elevador em cima
MoveObject(elevador,3028.8000000,-704.5996000,53.799999237061,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,53.799999237061,2.0);
SendClientMessage(playerid,COR_RED"[INFO] Elevador a Caminho.");
return 
1;
}
return 
0;

Й Press, nгo Pressed.
Reply
#7

Quote:
Originally Posted by ProKillerpa
Посмотреть сообщение
Presta atenзгo nй amigo

PHP код:

#define PRESS(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
// public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
if(PRESS(KEY_YES))
{
if(!
IsPlayerInRangeOfPoint(playerid7.03055,-708,11)) return 1;//chamar elevador embaixo
MoveObject(elevador,3028.8000000,-704.5996000,10.5,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,10.5,2.0);
SendClientMessage(playerid,COR_RED"[INFO] Elevador a Caminho.");
return 
1;
}
if(
PRESS(KEY_YES))
{
if(!
IsPlayerInRangeOfPoint(playerid7.03040,-712,54.90001525879)) return 1;//chamar elevador em cima
MoveObject(elevador,3028.8000000,-704.5996000,53.799999237061,2.0);
MoveObject(elevador2,3042.8000000,-705.5996000,53.799999237061,2.0);
SendClientMessage(playerid,COR_RED"[INFO] Elevador a Caminho.");
return 
1;
}
return 
0;

Й Press, nгo Pressed.
Vc tinha Posto PRESSED, Agora deu edite. Mas de Boa.

Tirou Minha Duvida

Vlw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)