Small error
#1

What's the problem with this
Код:
	if(IsPlayerInRangeOfObject(playerid, 987, 5.0)) //ERROR LINE
	{
	    SetPlayerHealth(playerid, 10);
	    return 1;
	}
Код:
warning 203: symbol is never used: "distance"
Код:
IsPlayerInRangeOfObject(playerid, objectid, Float:distance=5.0)
{
	new Float:x, Float:y, Float:z;
	GetObjectPos(objectid, x, y, z);
	return (GetPlayerDistanceFromPoint(playerid, x, y, z) < 5.0);
}
Reply
#2

pawn Код:
if(IsPlayerInRangeOfObject(playerid, 987, 5.0) //ERROR LINE
{
    SetPlayerHealth(playerid, 10);
    return 1;
}
Try this
Reply
#3

im sorry i don't know much about scripting and plus i don't see the problem there
Reply
#4

Quote:
Originally Posted by ReD_Boii
Посмотреть сообщение
pawn Код:
if(IsPlayerInRangeOfObject(playerid, 987, 5.0) //ERROR LINE
{
    SetPlayerHealth(playerid, 10);
    return 1;
}
Try this
Look at my code.
It's same.
Reply
#5

Код:
IsPlayerInRangeOfObject(playerid, objectid, Float:distance=5.0)
{
	new Float:x, Float:y, Float:z;
	GetObjectPos(objectid, x, y, z);
	return (GetPlayerDistanceFromPoint(playerid, x, y, z) < distance);
}
There you go!
Reply
#6

ah i see the one extra )
Reply
#7

Thanks. I havent noticed I had <5 at the end q.q
Reply
#8

yea lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)