SA-MP Forums Archive
Help with Gates - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with Gates (/showthread.php?tid=296560)



Help with Gates - trapstar2020 - 12.11.2011

Код:
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(93) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(106) : error 017: undefined symbol "PlayerToPoint"
C:\Documents and Settings\Lenovo\Desktop\Stuff\Server\gamemodes\tdm.pwn(116) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if (gTeam[playerid] == Vip)
{
if(PlayerToPoint(15.0, playerid,2501.8193359375, 2772.3293457031, 9.9023017883301))
{
MoveObject(hqgate0, 289.919067, -1547.427734, 27.193420, 1.500000);
MoveObject(hqgate1, 289.919067, -1547.427734, 27.193420, 1.500000);
return 1;
}
}
}

if(strcmp(cmdtext,"/closegate", true) == 0)
{
if (gTeam[playerid] == Vip)
{
if(PlayerToPoint(15.0, playerid,2501.8193359375, 2772.3293457031, 9.9023017883301))
{
MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90);
MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90);
return 1;
}
}
}
return 1;
}
return 0;
}


Re: Help with Gates - Pharrel - 12.11.2011

Use this on top of your script
pawn Код:
#define PlayerToPoint(%1,%2,%3,%4,%5) IsPlayerInRangeOfPoint(%2,%1,%3,%4,%5)
Or replace playertopoint...
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext,"/opengate", true) == 0)
    {
         if (gTeam[playerid] == Vip)
         {
             if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
             {
                 MoveObject(hqgate0, 289.919067, -1547.427734, 27.193420, 1.500000);
                 MoveObject(hqgate1, 289.919067, -1547.427734, 27.193420, 1.500000);
             }
        }
        return 1;
    }
    if(strcmp(cmdtext,"/closegate", true) == 0)
    {
        if (gTeam[playerid] == Vip)
        {
            if(IsPlayerInRangeOfPoint(playerid, 15.0, 2501.8193359375, 2772.3293457031, 9.9023017883301))
            {
                MoveObject(hqgate0, 2492.9870605469, 2772.6166992188, 9.9616632461548, 90);
                MoveObject(hqgate1, 2501.8193359375, 2772.3293457031, 9.9023017883301, 90);
            }
        }
        return 1;
    }
    return 0;
 }