SA-MP Forums Archive
Amunation interiours - 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: Amunation interiours (/showthread.php?tid=70814)



Amunation interiours - CAMERON_BANFIELD - 27.03.2009

Hi, on my server we do not allow guns, how can i block all the amunation interiours wirthout blocking all interiours or by putting objects there, how do i do this
Thanks
Cameron


Re: Amunation interiours - Dujma - 27.03.2009

With PlayerToPoint function and a timer


Re: Amunation interiours - CAMERON_BANFIELD - 27.03.2009

Please could you show me how to do that?
thanks


Re: Amunation interiours - MenaceX^ - 27.03.2009

Set a main timer (OnGameModeInit)
with 1000 milliseconds.

On the timer you need to check if a player is near X,Y,Z coords (If() statement with PlayerToPoint
If the player is near the place you defined. He gets teleported to another place


Re: Amunation interiours - weedarr - 27.03.2009

pawn Код:
if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
Do that in a timer like MenaceX said, and just change the cords

WeeDarr


Re: Amunation interiours - CAMERON_BANFIELD - 27.03.2009

Quote:
Originally Posted by WeeDarr
pawn Код:
if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
Do that in a timer like MenaceX said, and just change the cords

WeeDarr
Thnaks, is it possabe to add multiple places in that?


Re: Amunation interiours - Dujma - 27.03.2009

Quote:
Originally Posted by CAMERON_BANFIELD
Quote:
Originally Posted by WeeDarr
pawn Код:
if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
Do that in a timer like MenaceX said, and just change the cords

WeeDarr
Thnaks, is it possabe to add multiple places in that?
else if(PlayerToPoint


Re: Amunation interiours - weedarr - 27.03.2009

pawn Код:
if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
else if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
Etc. btw you will need to search for the playertopoint function

WeeDarr


Re: Amunation interiours - CAMERON_BANFIELD - 27.03.2009

thanks !!!


Re: Amunation interiours - Dujma - 27.03.2009

Quote:
Originally Posted by WeeDarr
pawn Код:
if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
else if(PlayerToPoint(10.0,i,checkpoint cords) == 1)
{
    // Do whatever
    SendClientMessage(i,COLOUR_YELLOW,"Closed");
}
Etc. btw you will need to search for the playertopoint function

WeeDarr
I use PlayerToPoint without that == 1. Why do you use that?

pawn Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
   if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}