Automatic Gate Code Problems
#1

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);
}
Reply
#2

Remove the function - problem solved.
Reply
#3

if i remove the function the gate wont work only open without close the gate LOL
Reply
#4

IsPlayerInRangeOfPoint is already implemented in SA-MP, you don't need to define it.
Reply
#5

and... what about the gate, it doesnt close when its open
Reply
#6

Show code, I can't know how is your code if you don't show it...
Reply
#7

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....
Reply
#8

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)