Gate error
#1

I made a gate system and it have error..

My cmds:

Код:
command(gate, playerid, params[])
{
     if(GateOpen == 0)
     {
          MoveObject(Gate, 1706.05115, 1607.58203, 5.82474);
          GateOpen = 1;
     }
     else
     {
          MoveObject(Gate, 1706.05115, 1607.58203, 11.89231);
          GateOpen = 0;
     }
     return 1;
}
command(gate, playerid, params[])
{
     if(Player[playerid][Group] == ( 0))
     {
          if(GateOpen == 0)
          {
               MoveObject(Gate, 1706.05115, 1607.58203, 5.82474);
               GateOpen = 1;
          }
          else
          {
               MoveObject(Gate, 1706.05115, 1607.58203, 11.89231);
               GateOpen = 0;
          }
     }
     else
     {
          SendClientMessage(playerid, color, "Command unavailable.");
     }
     return 1;
}
command(gate, playerid, params[])
{
     if(IsPlayerInRangeOfPoint(playerid, 5.0(range),1701.1674,1609.4799,10.4585,251.6833 ))
     {
          if(Player[playerid][Group] == (0))
               if(GateOpen == 0)
               {
                    MoveObject(Gate, 1706.05115, 1607.58203, 5.82474);
                    GateOpen = 1;
               }
               else
               {
                    MoveObject(Gate, 1706.05115, 1607.58203, 11.89231);
                    GateOpen = 0;
               }
          }
          else
          {
               SendClientMessage(playerid, color, "Command unavailable.");
          }
     }
     else
     {
          SendClientMessage(playerid, color, "You are not in range of the gate.");
     }
     return 1;
}
i already used: #include <a_samp> #include <zcmd>

But my errors:

Код:
D:\WORLD ATTACK\gamemodes\Test.pwn(589) : warning 202: number of arguments does not match definition
D:\WORLD ATTACK\gamemodes\Test.pwn(594) : warning 202: number of arguments does not match definition
D:\WORLD ATTACK\gamemodes\Test.pwn(600) : error 021: symbol already defined: "cmd_gate"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 017: undefined symbol "Player"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : warning 215: expression has no effect
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 001: expected token: ";", but found "]"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 029: invalid expression, assumed zero
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
But i don't have class/group i wanted that any body can open it with a pass like /o12 to open/close
Reply
#2

pawn Код:
if(PlayerInfo[playerid][Group] == 0)
show us Group variable and error line
Reply
#3

Error lines?:

Код:
D:\WORLD ATTACK\gamemodes\Test.pwn(589) : warning 202: number of arguments does not match definition
D:\WORLD ATTACK\gamemodes\Test.pwn(594) : warning 202: number of arguments does not match definition
D:\WORLD ATTACK\gamemodes\Test.pwn(600) : error 021: symbol already defined: "cmd_gate"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 017: undefined symbol "Player"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : warning 215: expression has no effect
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 001: expected token: ";", but found "]"
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 029: invalid expression, assumed zero
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#4

No... he means the lines 589, 594,600,601 in your script.
Reply
#5

589: MoveObject(Gate, 1706.05115, 1607.58203, 5.82474);
594: MoveObject(Gate, 1706.05115, 1607.58203, 11.89231);

600: {

601:if(Player[playerid][Group] == ( 0))
Reply
#6

Why do you have three commands which does the same thing?
Reply
#7

for
pawn Код:
589: MoveObject(Gate, 1706.05115, 1607.58203, 5.82474);
594: MoveObject(Gate, 1706.05115, 1607.58203, 11.89231);
pawn Код:
MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed, Float:RotX = -1000.0, Float:RotY = -1000.0, Float:RotZ = -1000.0)

for other errors show us the code of other lines
Reply
#8

Try using
pawn Код:
if(Player[playerid][Group] == 0)
instead of
pawn Код:
if(Player[playerid][Group] == ( 0))
D:\WORLD ATTACK\gamemodes\Test.pwn(601) : error 017: undefined symbol "Player"

Do you have something like this in your script?
pawn Код:
enum pInfo
{
    pPass, // These things can be anything
    pCash,
    pAdmin,
    pSex,
}
new Player[MAX_PLAYERS][pInfo]; // the pInfo here and at the begin could be something different.
Reply
#9

You have 3 cmds with same name, wont work.
You forgot the speed parameter in moveobject.
Reply
#10

This code is copy and pasted, and you have to rewrite it seriously.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)