SA-MP Forums Archive
IsPlayerInRangeOfPoint - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerInRangeOfPoint (/showthread.php?tid=245545)



IsPlayerInRangeOfPoint - CraZy_KiLLaH - 31.03.2011

pawn Code:
if(strcmp(cmdtext,"/nrg",true)==0)
        {
        if(DMArea[playerid] == 1) return ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"{FF0000}Error:","{00F6F6}Cannot teleport while at DM area","Exit","Cancel");
        if(IsPlayerInRangeOfPoint(playerid,7.0,169.4746,-1765.3291,14.7578))
        {
        SendClientMessage(playerid,red,"Test");
        }
        PlayerInDm[playerid] = 0;   HOP[playerid] = 1;  DMArea[playerid] = 0;
        SetPlayerFacingAngle(playerid,70.9471);
        SetPlayerPos(playerid,991.0759,-1823.6770,19.0977);
        DestroyVehicle(veh[playerid]);
        new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        veh[playerid] = CreateVehicle(522, 991.0759,-1823.6770,19.0977, 70.9471, -1, -1, -1);
        PutPlayerInVehicle(playerid, veh[playerid], 0);
        if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        PutPlayerInVehicle(playerid,veh[playerid] ,0);
        SetPlayerInterior(playerid,0);
        GameTextForPlayer(playerid,"~g~~h~NRG Parkour",2000,1);
        return 1;
        }
When i get to point,nothing happens.


Re: IsPlayerInRangeOfPoint - ronnie3148 - 31.03.2011

you for got the { after some if statement
Code:
       
if(strcmp(cmdtext,"/nrg",true)==0)
        {
        if(DMArea[playerid] == 1) return ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"{FF0000}Error:","{00F6F6}Cannot teleport while at DM area","Exit","Cancel");
       {
           if(IsPlayerInRangeOfPoint(playerid,7.0,169.4746,-1765.3291,14.7578))
          {
          SendClientMessage(playerid,red,"Test");
          }
             PlayerInDm[playerid] = 0;   HOP[playerid] = 1;  DMArea[playerid] = 0;
             SetPlayerFacingAngle(playerid,70.9471);
             SetPlayerPos(playerid,991.0759,-1823.6770,19.0977);
             DestroyVehicle(veh[playerid]);
             new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
             veh[playerid] = CreateVehicle(522, 991.0759,-1823.6770,19.0977, 70.9471, -1, -1, -1);
             PutPlayerInVehicle(playerid, veh[playerid], 0);
             if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
               {
               PutPlayerInVehicle(playerid,veh[playerid] ,0);
               SetPlayerInterior(playerid,0);
               GameTextForPlayer(playerid,"~g~~h~NRG Parkour",2000,1);
               } 
               return 1;

          }



Re: IsPlayerInRangeOfPoint - CraZy_KiLLaH - 31.03.2011

No,i haven't forgot any bracket!


Re: IsPlayerInRangeOfPoint - Tommy_Mandaz - 01.04.2011

pawn Code:
if(strcmp(cmdtext,"/nrg",true)==0)
{
    if(DMArea[playerid] == 1) return ShowPlayerDialog(playerid,1000,DIALOG_STYLE_MSGBOX,"{FF0000}Error:","{00F6F6}Cannot teleport while at DM area","Exit","Cancel");
    {
        if(IsPlayerInRangeOfPoint(playerid,7.0,169.4746,-1765.3291,14.7578))
        {
            SendClientMessage(playerid,red,"Test");
        }
        else
        {
            PlayerInDm[playerid] = 0;   HOP[playerid] = 1;  DMArea[playerid] = 0;
            SetPlayerFacingAngle(playerid,70.9471);
            SetPlayerPos(playerid,991.0759,-1823.6770,19.0977);
            DestroyVehicle(veh[playerid]);
            new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
            veh[playerid] = CreateVehicle(522, 991.0759,-1823.6770,19.0977, 70.9471, -1, -1, -1);
            PutPlayerInVehicle(playerid, veh[playerid], 0);
            if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
            PutPlayerInVehicle(playerid,veh[playerid] ,0);
            SetPlayerInterior(playerid,0);
            GameTextForPlayer(playerid,"~g~~h~NRG Parkour",2000,1);
            return 1;
            }
            }
            }