SA-MP Forums Archive
If player is in range and if player in faction - 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: If player is in range and if player in faction (/showthread.php?tid=269085)



If player is in range and if player in faction - Jack- - 14.07.2011

How do i do it so that they have to be in the faction and be in range of point ?

pawn Код:
if( !strcmp(cmdtext,"/cctv1",true ))
    {
        if (IsPlayerInRangeOfPoint(playerid, 3, 2250.8818,2489.7144,10.9908))
if(PlayerInfo[playerid][pFaction] != FACTION_LVPD) return SystemMsg(playerid, "You are not a member of LVPD! Or not range of the cctv station!");
        {
            SetPlayerCameraPos(playerid, 2105.4431,2163.4868,15.9372);
            SetPlayerCameraLookAt(playerid, 2125.3391,2124.7417,10.6719);
            TogglePlayerControllable(playerid,0);
            SendClientMessage (playerid, COLOR_GREEN, "The Strip CCTV #1");
        }
        return 1;
    }



Re: If player is in range and if player in faction - iGetty - 14.07.2011

pawn Код:
if( !strcmp(cmdtext,"/cctv1",true ))
    {
        if(PlayerInfo[playerid][pFaction] = FACTION_LVPD)
        {
        if (IsPlayerInRangeOfPoint(playerid, 3, 2250.8818,2489.7144,10.9908))
        {
            SetPlayerCameraPos(playerid, 2105.4431,2163.4868,15.9372);
            SetPlayerCameraLookAt(playerid, 2125.3391,2124.7417,10.6719);
            TogglePlayerControllable(playerid,0);
            SendClientMessage (playerid, COLOR_GREEN, "The Strip CCTV #1");
        }
        else
        {
            SystemMsg(playerid, "You are not a member of LVPD! Or not range of the cctv station!");
        }
        return 1;
    }



Re: If player is in range and if player in faction - Jack- - 14.07.2011

Thank you


Re: If player is in range and if player in faction - PrawkC - 14.07.2011

pawn Код:
if(!strcmp(cmdtext,"/cctv1",true ))
{
    if(PlayerInfo[playerid][pFaction] != FACTION_LVPD) return SystemMsg(playerid, "You are not a member of LVPD! Or not range of the cctv station!");
    if(IsPlayerInRangeOfPoint(playerid, 3, 2250.8818,2489.7144,10.9908))
    {
        SetPlayerCameraPos(playerid, 2105.4431,2163.4868,15.9372);
        SetPlayerCameraLookAt(playerid, 2125.3391,2124.7417,10.6719);
        TogglePlayerControllable(playerid,0);
        SendClientMessage (playerid, COLOR_GREEN, "The Strip CCTV #1");
    }
    return 1;
}



Re: If player is in range and if player in faction - =WoR=Varth - 15.07.2011

pawn Код:
if(PlayerInfo[playerid][pFaction] != FACTION_LVPD) return SystemMsg(playerid, "You are not a member of LVPD! Or not range of the cctv station!");
Move "Or not range of the cctv station!"