Gate problems...
#1

I have the following errors:
pawn Код:
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(116) : warning 204: symbol is assigned a value that is never used: "depotgateleft"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(115) : warning 204: symbol is assigned a value that is never used: "depotgateright"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(115 -- 126) : error 017: undefined symbol "PlayerToPoint"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(128) : error 017: undefined symbol "depotgateright"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(129) : error 017: undefined symbol "depotgateright"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(130) : error 017: undefined symbol "depotgateleft"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(131) : error 017: undefined symbol "depotgateleft"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(141) : error 017: undefined symbol "PlayerToPoint"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(143) : error 017: undefined symbol "depotgateright"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(144) : error 017: undefined symbol "depotgateright"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(145) : error 017: undefined symbol "depotgateleft"
C:\Users\Ashley Hardy\SA-MP Stuff!\filterscripts\zeroscompany.pwn(146) : error 017: undefined symbol "depotgateleft"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


10 Errors.
And here is the code:

pawn Код:
public OnFilterScriptInit()
{   //GATE
    new Float:depotgateright;
    new Float:depotgateleft;
   
    depotgateright = CreateObject(985, 1422.1618652344, 657.21002197266, 11.396879196167, 0.0, 0.0, 268.46499633789);
    depotgateleft = CreateObject(986, 1422.1472167969, 657.92846679688, 11.421867370605, 0.0, 0.0, 272.38998413086);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/opengate", true) == 0)
    {
        if (GetPlayerScore(playerid) > 99)
        {
            if(PlayerToPoint(20.0, playerid, 1424.0, 654.0, 11.0))
            {
                MoveObject(depotgateright, 1418.4020996094, 646.84167480469, 11.396879196167, 1.500000);
                SetObjectRot(depotgateright, 0.0, 0.0, 337.93640136719);
                MoveObject(depotgateleft, 1418.1403808594, 659.62316894531, 11.421867370605, 1.500000);
                SetObjectRot(depotgateleft, 0.0, 0.0, 202.91461181641);
                return 1;
            }
        }
    }

    if(strcmp(cmdtext,"/closegate", true) == 0)
    {
        if (GetPlayerScore(playerid) > 99)
        {
            if(PlayerToPoint(20.0, playerid, 1424.0, 654.0, 11.0))
            {
                MoveObject(depotgateright, 1422.1618652344, 657.21002197266, 11.396879196167, 1.500000);
                SetObjectRot(depotgateright, 0.0, 0.0, 268.46499633789);
                MoveObject(depotgateleft, 1422.1472167969, 657.92846679688, 11.421867370605, 1.500000);
                SetObjectRot(depotgateleft, 0.0, 0.0, 272.38998413086);
                return 1;
            }
        }
    }
    return 0;
}
I dont see what is wrong. Could somebody take a look?

Thanks
Ash
Reply
#2

pawn Код:
new Float:depotgateright;
new Float:depotgateleft;
should be at the very top of your script, just under includes and macros.

Use IsPlayerInRangeOfPoint instead of PlayerToPoint
Reply
#3

move new Float:depotgateright; and new Float:depotgateleft; above OnFilterScriptInit that will fix all but one

pawn Код:
new Float:depotgateright;
new Float:depotgateleft;

public OnFilterScriptInit()
{   //GATE
the remaining error looks like you just dont have the playertopoint stock, which you will need to find
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)