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



SetPlayerPos... - FireCat - 30.07.2010

How can i make that when someone goes against this door




they teleport to another place?


Re: SetPlayerPos... - Ash. - 30.07.2010

pawn Код:
forward DoorCheck(playerid);
public DoorCheck(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, doorx, doory, doorz, 1)
    {
        SetPlayerPos(playerid, yourx, youry, yourz);
        SetPlayerFacingAngle(playerid, facingangle); // Remove if not needed :)
    }
}
And in your filterscript/gamemode set a timer to run every, uhmm, 3 seconds maybe?

pawn Код:
SetTimerEx("DoorCheck(playerid)", 3000, true, "i", playerid);
Not very efficient i know, but it gets the job done


Re: SetPlayerPos... - Cameltoe - 30.07.2010

You should add a pickup there the info icon pickup is well used for this.

and on OnPlayerPickUpPickup check for the pickup and add the IsPlayerInRangeOfPoint as funky said.

if you get stuck feel free to add me on msn or send me an pm.


Re: SetPlayerPos... - FireCat - 30.07.2010

thanks


Re: SetPlayerPos... - Ash. - 30.07.2010

Anytime (im online)


Re: SetPlayerPos... - FireCat - 30.07.2010

it dosnt work D: sorry for my other comment i fought it would work but it dosnt D:
here 77.54.98.38:7777 im there


Re: SetPlayerPos... - Mike Garber - 30.07.2010

pawn Код:
// TOP
forward DoorCheck();

// ANYWHERE
public DoorCheck()
{
    for(new i = 0; i < MAX_PLAYERS; i++){
        if(IsPlayerInRangeOfPoint(i, doorx, doory, doorz, 1)
        {
            SetPlayerPos(i, yourx, youry, yourz);
            SetPlayerFacingAngle(i, facingangle); // Remove if not needed :)
        }
    }
}

// ONGAMEMODEINIT
    SetTimer("DoorCheck",2000,1);
This one should work.


Re: SetPlayerPos... - Guest3598475934857938411 - 31.07.2010

Cameltoe, yep ur right he should make a pickup then on OnPlayerPickup he should execute the code!