SetPlayerPos...
#1

How can i make that when someone goes against this door




they teleport to another place?
Reply
#2

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
Reply
#3

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.
Reply
#4

thanks
Reply
#5

Anytime (im online)
Reply
#6

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
Reply
#7

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.
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)