Help with Gates
#1

Код:
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;
}
Reply
#2

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;
 }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)