Attempting to script my own house
#4

Quote:
Originally Posted by Mr. M
Quote:
Originally Posted by =>Sandra<=
Код:
if(X == 2049.48 && Y == 2763.07 && Z == 10.82)
Thanks, Sandra. That removes 1 error.
Still got this one;
Код:
C:\Documents and Settings\Mitch\Desktop\SERVER\filterscripts\AdminCrib.pwn(39) : error 030: compound statement not closed at the end of file (started at line 24)
Quote:
Originally Posted by =>Sandra<=
But because the coords are very precise, it's almost impossible to be exactly at those coords. Better search for a PlayerToPoint-function and use that.
Since i'm kinda new at scripting, i don't understand PlayerToPoint . Can't really find a help topic about it.
Also you don't need a loop. Just take the player that did the /enter command (playerid) and get his position, then use PlayerToPoint.

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;
}
How to use it? use
pawn Код:
if(PlayerToPoint(3, playerid, x, y, z))
3 - the radius. 2 is normal. 5 is for cars.
playerid - which player to check
x, y, z - where the player shall be

Hope you got it
Reply


Messages In This Thread
Attempting to script my own house - by Mr. M - 07.02.2009, 12:23
Re: Attempting to script my own house - by Sandra18[NL] - 07.02.2009, 12:41
Re: Attempting to script my own house - by Mr. M - 07.02.2009, 12:48
Re: Attempting to script my own house - by pspleo - 07.02.2009, 12:55
Re: Attempting to script my own house - by Mr. M - 07.02.2009, 13:05
Re: Attempting to script my own house - by Auto-Sized - 07.02.2009, 14:28
Re: Attempting to script my own house - by Mr. M - 07.02.2009, 17:33
Re: Attempting to script my own house - by Auto-Sized - 07.02.2009, 20:32
Re: Attempting to script my own house - by Mr. M - 07.02.2009, 20:38
Re: Attempting to script my own house - by Auto-Sized - 07.02.2009, 22:24

Forum Jump:


Users browsing this thread: 1 Guest(s)