automatic gate help
#1

The other problem was fixed now i got another

pawn Code:
public GateCheck()
{
    new admingate1Open;
    for(new playerid; playerid<MAX_PLAYERS; playerid++)
    {
    if(IsPlayerInRangeOfPoint(playerid,10.0,2220.3957,-1139.3205,25.6949))admingate1Open=1;
    }
    //MyGate1
 //this line is giving the error   if(admingate1Open)MoveObject(admingate1,2227.585693, -1146.666138, 26.401253); //These are the coordinates of the gate if it were in it's opened state.
  // so is this one  else MoveObject(admingate1,2220.193115, -1144.315796, 26.401253);//These are the coordinates of the gate if it were in it's closed state.
   
}
The lines i have marked above are giving the warning i pasted below

warning 202: number of arguments does not match definition

another question i got is, why is my gate tilted sideways when i approach it instead of moving to the open coord that i have saved ?

Thanks for your help guys much appreciated
Reply
#2

Quote:
Originally Posted by Stryke
View Post
hey guys, i get this problem and dont know how to fix it, can you guys help me?

error 001: expected token: ")", but found "-identifier-"

pawn Code:
public GateCheck()
{
    new admingate1Open;
    for(new playerid; playerid<MAX_PLAYERS; playerid++)
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,2220.3957,-1139.3205,25.6949)admingate1Open=1; // this is the line giving the error

    }
    //MyGate1
    if(admingate1Open)MoveObject(admingate1,2227.585693, -1146.666138, 26.401253); //These are the coordinates of the gate if it were in it's opened state.
    else MoveObject(admingate1,2220.164795, -1144.388916, 26.401253);//These are the coordinates of the gate if it were in it's closed state.
   
}
Thanks
Simply add a ) more, so it will be like this:

pawn Code:
public GateCheck()
{
    new admingate1Open;
    for(new playerid; playerid<MAX_PLAYERS; playerid++)
    {
        if(IsPlayerInRangeOfPoint(playerid,10.0,2220.3957,-1139.3205,25.6949))admingate1Open=1; // this is the line giving the error
                                                           //Added A ) Sign ^

    }
    //MyGate1
    if(admingate1Open)MoveObject(admingate1,2227.585693, -1146.666138, 26.401253); //These are the coordinates of the gate if it were in it's opened state.
    else MoveObject(admingate1,2220.164795, -1144.388916, 26.401253);//These are the coordinates of the gate if it were in it's closed state.
   
}
Reply
#3

ahhh thanks for that I didnt notice that lol, ill look a bit more carefully next time, but could you help me with one more thing?

I get this error twice for the two lines below
warning 202: number of arguments does not match definition

pawn Code:
//MyGate1
    if(admingate1Open)MoveObject(admingate1,2227.585693, -1146.666138, 26.401253); //These are the coordinates of the gate if it were in it's opened state.
    else MoveObject(admingate1,2220.164795, -1144.388916, 26.401253);//These are the coordinates of the gate if it were in it's closed state.
Reply
#4

Quote:
Originally Posted by Stryke
View Post
ahhh thanks for that I didnt notice that lol, ill look a bit more carefully next time, but could you help me with one more thing?

I get this error twice for the two lines below
warning 202: number of arguments does not match definition

pawn Code:
//MyGate1
    if(admingate1Open)MoveObject(admingate1,2227.585693, -1146.666138, 26.401253); //These are the coordinates of the gate if it were in it's opened state.
    else MoveObject(admingate1,2220.164795, -1144.388916, 26.401253);//These are the coordinates of the gate if it were in it's closed state.
Well In Your MoveObject you wrote 4 parametres (objectid, x, y z) but MoveObject requires 5 paremetres (objectid, x, y, z, speed)

Example:

pawn Code:
MoveObject(admingate1,2220.164795, -1144.388916, 26.401253); //<<< From This
MoveObject(admingate1,2220.164795, -1144.388916, 26.401253, 2.00); //<<< To This (2.00 is the speed, it's just an example, change the speed to whatever u want it to be)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)