Player to point? -
_COTTA_ - 09.03.2010
Boas tardes,
Estava a fazer um sistema de entrar em casa, e quando compilei tudo deu este erro :S
Код:
C:\Users\_COTTA_\Desktop\mdogg.pwn(95) : warning 217: loose indentation
C:\Users\_COTTA_\Desktop\mdogg.pwn(114) : error 017: undefined symbol "PlayerToPoint"
C:\Users\_COTTA_\Desktop\mdogg.pwn(125) : error 017: undefined symbol "PlayerToPoint"
C:\Users\_COTTA_\Desktop\mdogg.pwn(138) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Os das linha 114 e 125 nao sei como corrigir :S, pois vejam como fiz:
Код:
#include <a_samp>
#include <core>
#include <float>
#include <a_objects>
#include <a_samp>
#include <float>
//----------colors-----------
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLUE 0x33AAFFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF69B4FF
#define COLOR_BGREEN 0x08FD04FF
#define COLOR_CYAN 0x00FFFFAA
#define COLOR_RED 0xFF3366FF
#define COLOR_YELLOW 0xFFCC33FF
#define COLOR_DGREEN 0x008000FF
#define COLOR_DRED 0x800000FF
#define COLOR_DARK 0x000000FF
#define TEAM_GREEN_COLOR 0x33AA33AA
#define TEAM_BLUE_COLOR 0x3333AAAA
#define COLOR_GRAD2 0xBFC0C2FF
#define SOUND_MUSIC1 1076
#define SOUND_OFF 1184
#define COLOR_CONTRABANDISTA 0x6A95AEAA
new p1;
main()
{
print("\n----------------------------------");
print("-.............................................:)\n");
print("----------------------------------\n");
return 0;
}
public OnGameModeInit()
{
CreateObject(8841, -2684.6569824219, 1341.9689941406, 19.32400894165, 0, 0, 0);
CreateObject(8040, -2743.4951171875, 1330.271484375, 16.759454727173, 0, 0, 0);
CreateObject(8947, -2770.6166992188, 1320.0007324219, 19.419242858887, 0, 0, 89.324493408203);
p1 = CreateObject(18483, -2624.9851074219, 1350.7390136719,9.8020057678223,0,10.410003662109,0);
AddStaticPickup(1318,1,-3121.2126,1127.3942,20.9771); //enter hq
return 1;
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~RPG: ~r~GRUPO [REAL]!",5000,5);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);//Music Off
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
ApplyAnimation(playerid,"COP_AMBIENT", "Coplook_loop", 4.0, 1, 0, 0, 0, 0);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid,0x800000FF,"Para ver o seu nivel use /vernivel para ajuda nos niveis use /niveis!");
SendClientMessage(playerid,0xAFAFAFAA,"NOTA: Ganha niveis a cada requesito de nivel pedido aliado as horas de jogo!");
PlayerPlaySound(playerid,1186,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/apark", true) ==0)
{
MoveObject(p1,-2624.9851074219, 1350.7390136719,9.8020057678223,1); //CORDENADAS DELE ABERTO
return 1;
}
if (strcmp(cmdtext, "/fpark", true) ==0)
{
MoveObject(p1,-2625.7277832031, 1350.6324462891, 5.3520057678223,1); //CORDENADAS DELE FECHADO
return 1;
}
// CAMILO CASA
//hs
if (strcmp(cmdtext, "/entrarcasa", true)==0)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,1523.509887,-47.821197,1002.130981);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc entrou na casa do player Gulono_Camilo, Bem Vindo!");
}
if(strcmp(cmdtext,"/Saircasa",true)==0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-3121.2126,1127.3942,20.9771);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu da casa de Gulono_Camilo!");
}
//////////////////////////////////////
//CASA
//shop
if (strcmp(cmdtext, "/ENTRARSHOP", true)==0)
{
if(PlayerToPoint(1, playerid, 746.2035,-2570.2080,10.0439))
{
SetPlayerInterior(playerid,10);
SetPlayerPos(playerid,6.091180,-29.271898,1003.549988);
return SendClientMessage(playerid,0xFFFFFFAA,"VC entrou no shop, compre algo e Boas Compras ;)!");
}
return 1;
}
if(strcmp(cmdtext,"/SAIRSHOP",true)==0)
{
if(PlayerToPoint(1.0,playerid,6.0007,-31.2342,1003.5494))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,741.4668,-2570.1621,9.8830);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu do shop!");
}
return 1;
}
///////////////
return 0;
}
Agradeзo sisceramente ajuda no assunto caso algem saiba
Obrigado
Re: Player to point? -
SlashPT - 09.03.2010
pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz);
public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -xx);
tempposy = (oldposy -yy);
tempposz = (oldposz -zz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
simples...
Re: Player to point? -
_COTTA_ - 09.03.2010
Es a minha salvaзгo dark xD
Obrigado
Re: Player to point? -
_COTTA_ - 09.03.2010
LOL fiz isso e olhe o que deu :P
mais erros do que ja tinha eheh
Код:
C:\Users\_COTTA_\Desktop\mdogg.pwn(97) : warning 217: loose indentation
C:\Users\_COTTA_\Desktop\mdogg.pwn(116) : error 004: function "PlayerToPoint" is not implemented
C:\Users\_COTTA_\Desktop\mdogg.pwn(127) : error 004: function "PlayerToPoint" is not implemented
C:\Users\_COTTA_\Desktop\mdogg.pwn(137) : warning 217: loose indentation
C:\Users\_COTTA_\Desktop\mdogg.pwn(137) : error 029: invalid expression, assumed zero
C:\Users\_COTTA_\Desktop\mdogg.pwn(137) : error 004: function "PlayerToPoint" is not implemented
C:\Users\_COTTA_\Desktop\mdogg.pwn(144) : error 017: undefined symbol "xx"
C:\Users\_COTTA_\Desktop\mdogg.pwn(145) : error 017: undefined symbol "yy"
C:\Users\_COTTA_\Desktop\mdogg.pwn(146) : error 017: undefined symbol "zz"
C:\Users\_COTTA_\Desktop\mdogg.pwn(147) : error 017: undefined symbol "radi"
C:\Users\_COTTA_\Desktop\mdogg.pwn(154) : error 030: compound statement not closed at the end of file (started at line 82)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Errors.
Sera que implementei correctamente?
Код:
#include <a_samp>
#include <core>
#include <float>
#include <a_objects>
#include <a_samp>
#include <float>
//----------colors-----------
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLUE 0x33AAFFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF69B4FF
#define COLOR_BGREEN 0x08FD04FF
#define COLOR_CYAN 0x00FFFFAA
#define COLOR_RED 0xFF3366FF
#define COLOR_YELLOW 0xFFCC33FF
#define COLOR_DGREEN 0x008000FF
#define COLOR_DRED 0x800000FF
#define COLOR_DARK 0x000000FF
#define TEAM_GREEN_COLOR 0x33AA33AA
#define TEAM_BLUE_COLOR 0x3333AAAA
#define COLOR_GRAD2 0xBFC0C2FF
#define SOUND_MUSIC1 1076
#define SOUND_OFF 1184
#define COLOR_CONTRABANDISTA 0x6A95AEAA
forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz);
new p1;
main()
{
print("\n----------------------------------");
print("-GGGGGGGGG:)\n");
print("----------------------------------\n");
return 0;
}
public OnGameModeInit()
{
CreateObject(8841, -2684.6569824219, 1341.9689941406, 19.32400894165, 0, 0, 0);
CreateObject(8040, -2743.4951171875, 1330.271484375, 16.759454727173, 0, 0, 0);
CreateObject(8947, -2770.6166992188, 1320.0007324219, 19.419242858887, 0, 0, 89.324493408203);
p1 = CreateObject(18483, -2624.9851074219, 1350.7390136719,9.8020057678223,0,10.410003662109,0);
AddStaticPickup(1318,1,-3121.2126,1127.3942,20.9771); //enter hq
return 1;
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~RPG: ~r~GRUPO [REAL]!",5000,5);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);//Music Off
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
ApplyAnimation(playerid,"COP_AMBIENT", "Coplook_loop", 4.0, 1, 0, 0, 0, 0);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid,0x800000FF,"Para ver o seu nivel use /vernivel para ajuda nos niveis use /niveis!");
SendClientMessage(playerid,0xAFAFAFAA,"NOTA: Ganha niveis a cada requesito de nivel pedido aliado as horas de jogo!");
PlayerPlaySound(playerid,1186,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/apark", true) ==0)
{
MoveObject(p1,-2624.9851074219, 1350.7390136719,9.8020057678223,1); //CORDENADAS DELE ABERTO
return 1;
}
if (strcmp(cmdtext, "/fpark", true) ==0)
{
MoveObject(p1,-2625.7277832031, 1350.6324462891, 5.3520057678223,1); //CORDENADAS DELE FECHADO
return 1;
}
//hq CAMILO CASA!
//hq
if (strcmp(cmdtext, "/entrarcasa", true)==0)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,1523.509887,-47.821197,1002.130981);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc entrou na casa do player Gulono_Camilo, Bem Vindo!");
}
if(strcmp(cmdtext,"/Saircasa",true)==0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-3121.2126,1127.3942,20.9771);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu da casa de Gulono_Camilo!");
}
//////////////////////////////////////
//CASA
//shop
if (strcmp(cmdtext, "/ENTRARSHOP", true)==0)
{
if(PlayerToPoint(1, playerid, 746.2035,-2570.2080,10.0439))
{
SetPlayerInterior(playerid,10);
SetPlayerPos(playerid,6.091180,-29.271898,1003.549988);
return SendClientMessage(playerid,0xFFFFFFAA,"VC entrou no shop, compre algo e Boas Compras ;)!");
}
return 1;
}
if(strcmp(cmdtext,"/SAIRSHOP",true)==0)
{
if(PlayerToPoint(1.0,playerid,6.0007,-31.2342,1003.5494))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,741.4668,-2570.1621,9.8830);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu do shop!");
}
return 1;
}
///////////////
public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -xx);
tempposy = (oldposy -yy);
tempposz = (oldposz -zz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
Re: Player to point? -
SlashPT - 09.03.2010
tenta este
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include <a_objects>
#include <a_samp>
#include <float>
//----------colors-----------
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_BLUE 0x33AAFFFF
#define COLOR_GREEN 0x33AA33AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PINK 0xFF69B4FF
#define COLOR_BGREEN 0x08FD04FF
#define COLOR_CYAN 0x00FFFFAA
#define COLOR_RED 0xFF3366FF
#define COLOR_YELLOW 0xFFCC33FF
#define COLOR_DGREEN 0x008000FF
#define COLOR_DRED 0x800000FF
#define COLOR_DARK 0x000000FF
#define TEAM_GREEN_COLOR 0x33AA33AA
#define TEAM_BLUE_COLOR 0x3333AAAA
#define COLOR_GRAD2 0xBFC0C2FF
#define SOUND_MUSIC1 1076
#define SOUND_OFF 1184
#define COLOR_CONTRABANDISTA 0x6A95AEAA
forward PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz);
new p1;
main()
{
print("\n----------------------------------");
print("-GGGGGGGGG:)\n");
print("----------------------------------\n");
return 0;
}
public OnGameModeInit()
{
CreateObject(8841, -2684.6569824219, 1341.9689941406, 19.32400894165, 0, 0, 0);
CreateObject(8040, -2743.4951171875, 1330.271484375, 16.759454727173, 0, 0, 0);
CreateObject(8947, -2770.6166992188, 1320.0007324219, 19.419242858887, 0, 0, 89.324493408203);
p1 = CreateObject(18483, -2624.9851074219, 1350.7390136719,9.8020057678223,0,10.410003662109,0);
AddStaticPickup(1318,1,-3121.2126,1127.3942,20.9771); //enter hq
return 1;
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~RPG: ~r~GRUPO [REAL]!",5000,5);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);//Music Off
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
ApplyAnimation(playerid,"COP_AMBIENT", "Coplook_loop", 4.0, 1, 0, 0, 0, 0);
PlayerPlaySound(playerid,1185,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerSpawn(playerid)
{
SendClientMessage(playerid,0x800000FF,"Para ver o seu nivel use /vernivel para ajuda nos niveis use /niveis!");
SendClientMessage(playerid,0xAFAFAFAA,"NOTA: Ganha niveis a cada requesito de nivel pedido aliado as horas de jogo!");
PlayerPlaySound(playerid,1186,2050.1995, 1344.5500, 13.2378);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/apark", true) ==0)
{
MoveObject(p1,-2624.9851074219, 1350.7390136719,9.8020057678223,1); //CORDENADAS DELE ABERTO
return 1;
}
if (strcmp(cmdtext, "/fpark", true) ==0)
{
MoveObject(p1,-2625.7277832031, 1350.6324462891, 5.3520057678223,1); //CORDENADAS DELE FECHADO
return 1;
}
if (strcmp(cmdtext, "/entrarcasa", true)==0)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,1523.509887,-47.821197,1002.130981);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc entrou na casa do player Gulono_Camilo, Bem Vindo!");
}
if(strcmp(cmdtext,"/Saircasa",true)==0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,-3121.2126,1127.3942,20.9771);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu da casa de Gulono_Camilo!");
}
if (strcmp(cmdtext, "/ENTRARSHOP", true)==0)
{
if(PlayerToPoint(1, playerid, 746.2035,-2570.2080,10.0439))
{
SetPlayerInterior(playerid,10);
SetPlayerPos(playerid,6.091180,-29.271898,1003.549988);
return SendClientMessage(playerid,0xFFFFFFAA,"VC entrou no shop, compre algo e Boas Compras ;)!");
}
return 1;
}
if(strcmp(cmdtext,"/SAIRSHOP",true)==0)
{
if(PlayerToPoint(1.0,playerid,6.0007,-31.2342,1003.5494))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,741.4668,-2570.1621,9.8830);
return SendClientMessage(playerid,0xFFFFFFAA,"Vc saiu do shop!");
}
return 1;
}
return 0;
}
public PlayerToPoint(Float:radi, playerid, Float:xx, Float:yy, Float:zz)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -xx);
tempposy = (oldposy -yy);
tempposz = (oldposz -zz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
Re: Player to point? -
_COTTA_ - 10.03.2010
Deu certo dark obrigadissimo
Ajudou e muito