Movegate Errors
#1

Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT

#endif

new Gate,
    bool:Open;
    
//Single gate
public OnFilterScriptInit()
{
    Gate = CreateObject(989,F1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962,Float:DrawDistance = 0.0);
    return 1;
}

CMD:gate(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,1428.6456, 242.0033, 20.3020)//Gate 1
    {
        switch(Open{0})//Check whether the gate opened or closed
        {
            case true://If the gate opened
            {
                MoveObject(Gate[0],1428.6456, 242.0033, 20.3020,4);//Close the gate
                Open{0} == false;//false for closed
            }
            case false://If the gate closed
            {
                MoveObject(Gate[0],1426.5259, 237.4716, 20.3020,4);//Open the gate
                Open{0} == true;//true for opened
            }
        }
        return 1;
    }
    SendClientMessage(playerid,color,"You're not close enough to the gate.");//Send error message if player isn't near any gate
    return 1;
}
Errors
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "F1428"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "DrawDistance"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : fatal error 107: too many error messages on one line

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


4 Errors.
If someone could help, that'd be muchly appreciated, thanks.
Reply
#2

pawn Код:
switch(Open)//Check whether the gate opened or closed
        {
            case true://If the gate opened
            {
                MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate
                Open = false;//false for closed
            }
            case false://If the gate closed
            {
                MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate
                Open = true;//true for opened
            }
        }
You also need to make Gate = CreateObject(...) //The object you're moving.
Reply
#3

Still get the same errors.
Reply
#4

Replace the switch statement with the one I have above
Reply
#5

I did.
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 017: undefined symbol "DrawDistance"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : warning 215: expression has no effect
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 001: expected token: ";", but found ")"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(16) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#6

This is line 16
Код:
Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962,Float:DrawDistance = 0.0);
Reply
#7

Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962, 0.0);
Reply
#8

Код:
 C:\Users\Josh\Desktop\FCSLRP\filterscripts\Moving Gates.pwn(25) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Line 25?
Reply
#10

Just a {
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)