No funciona y da un warning
#1

Estuve haciendo una funcion para detectar que estas cerca de un coche pero me da un warning y si estoy cerca me dice que estoy lejos =/

pawn Код:
YCMD:idcoche(playerid, params[], help)
{
if (help) SendClientMessage(playerid, 0xFF0000AA, "Se utiliza para omprobar la id de un coche"); // Esto no sale si se usa el comando
else
{
new string[80];
new Cochec;
Cochec= GetPlayerVehicleID(playerid);
if(!JugadorCercaVehiculo(playerid,Cochec,2.0)) return SendClientMessage(playerid,-1,"No estбs cerca de ningun coche");
format(string,sizeof(string),"[OOC]:La id de este coche es %s",Cochec);
Message(playerid, COLOR_WHITE, string);
return 1;
}
return 1;
}
Me da warning 213: tag mismatch

pawn Код:
if(!JugadorCercaVehiculo(playerid,Cochec,2.0)) return SendClientMessage(playerid,-1,"No estбs cerca de ningun coche");
pero no funciona siempre sale que no estas cerca .Gracias por su ayuda Saludos
Reply
#2

Proba Sacandole El Signo de admiracion a El JugadorCercaVehiculo 1.
Reply
#3

Sigue igual D:
Reply
#4

Como tenes definido JugadorCercaVehiculo?
Reply
#5

pawn Код:
stock JugadorCercaVehiculo(Float:radi, playerid, vehicleid)
{
if(IsPlayerConnected(playerid))
{
new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,PX,PY,PZ);
GetVehiclePos(vehicleid, X,Y,Z);
new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
if(Distance <= radi*radi)
{
return true;
}
}
return false;
}
Reply
#6

Es que estбs definiendo radio, playerid y vehicleid, y al usarlo lo haces desordenado, playerid, vehicleid y radio.
Probб asн:

pawn Код:
if(!JugadorCercaVehiculo(2.0,playerid,Cochec)) return SendClientMessage(playerid,-1,"No estбs cerca de ningun coche");
Reply
#7

Muchas gracias
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)