Automatic Gate Code Problems -
AK47317 - 05.11.2010
hi again...
can u guys solve this problem of the code its been 2 days finding the solution of this errors. Hope u guys know how to solve it...
Код:
error 021: symbol already defined: "IsPlayerInRangeOfPoint"
error 021: symbol already defined: "GetPlayerPos"
error 010: invalid function or declaration
warning 203: symbol is never used: "px"
warning 203: symbol is never used: "py"
warning 203: symbol is never used: "pz"
the line:
pawn Код:
stock IsPlayerInRangeOfPoint(playerid, Float:radius, Float:X, Float:Y, Float:Z)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
return((((px-X)*(px-X))+((py-Y)*(py-Y))+((pz-Z)*(pz-Z))) >= radius*radius);
}
Re: Automatic Gate Code Problems -
LarzI - 05.11.2010
Remove the function - problem solved.
Re: Automatic Gate Code Problems -
AK47317 - 06.11.2010
if i remove the function the gate wont work only open without close the gate LOL
Re: Automatic Gate Code Problems -
LarzI - 06.11.2010
IsPlayerInRangeOfPoint is already implemented in SA-MP, you don't need to define it.
Re: Automatic Gate Code Problems -
AK47317 - 06.11.2010
and... what about the gate, it doesnt close when its open
Re: Automatic Gate Code Problems -
The_Moddler - 06.11.2010
Show code, I can't know how is your code if you don't show it...
Re: Automatic Gate Code Problems -
AK47317 - 06.11.2010
pawn Код:
stock IsPlayerInRangeOfPoint(playerid, Float:radius, Float:X, Float:Y, Float:Z)
{
new Float:px, Float:py, Float:pz;
GetPlayerPos(playerid, px, py, pz);
return((((px-X)*(px-X))+((py-Y)*(py-Y))+((pz-Z)*(pz-Z))) >= radius*radius);
}
tha function....
pawn Код:
public CheckEnteranceGateToMove(playerid)
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, -2896.298096, 1235.049805, 8.874954)) mygate_status = 1;
}
if(mygate_status)MoveObject(enterance, -2896.298096, 1235.049805, 2.874954, 2.0);
else if(mygate_status)MoveObject(enterance, -2896.298096, 1235.049805, 8.874954, 2.0);
}
tha automatic gate code....
Re: Automatic Gate Code Problems -
MadeMan - 06.11.2010
Delete the IsPlayerInRangeOfPoint function and change this
pawn Код:
public CheckEnteranceGateToMove(playerid)
{
mygate_status = 0;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, -2896.298096, 1235.049805, 8.874954)) mygate_status = 1;
}
if(mygate_status)MoveObject(enterance, -2896.298096, 1235.049805, 2.874954, 2.0);
else MoveObject(enterance, -2896.298096, 1235.049805, 8.874954, 2.0);
}