SA-MP Forums Archive
Aanyone know a code for an auto tele - 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: Aanyone know a code for an auto tele (/showthread.php?tid=94685)



Aanyone know a code for an auto tele - braduz - 31.08.2009

what I mean is someone stands at the front of a house and theres a red circle u stand in it and you have to type the password eg /password and then you go into the interior
but you have to be in the circle to do it allso a message that comes on the chat when u enter the red circle:
This is bobs hq, password?


Re: Aanyone know a code for an auto tele - James_Alex - 31.08.2009

yu can use "PlayerToPoint" you can found it in the GF script
then create a password for each house and use "strcmp" to check it


Re: Aanyone know a code for an auto tele - braduz - 31.08.2009

Quote:
Originally Posted by ► James_Alex
yu can use "PlayerToPoint" you can found it in the GF script
then create a password for each house and use "strcmp" to check it
?? clearer wherr to find this gf wtf it is?


Re: Aanyone know a code for an auto tele - James_Alex - 31.08.2009

The Godfather script


Re: Aanyone know a code for an auto tele - mirkoiz - 31.08.2009

Quote:

?? clearer wherr to find this gf wtf it is?

pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);


public 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);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}



Re: Aanyone know a code for an auto tele - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
Quote:

?? clearer wherr to find this gf wtf it is?

pawn Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);


public 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);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
ok now where do i put the location to goto the tele and the location the tele sends u too and the text :S


Re: Aanyone know a code for an auto tele - mirkoiz - 31.08.2009

Quote:
Originally Posted by braduz
ok now where do i put the location to goto the tele and the location the tele sends u too and the text :S
Give me the positions i will give you a script or just contact me (PM, MSN or whatever)

(b.t.w:
pawn Код:
PlayerToPoint(10, playerid, x, y, Z)
will ask if the player is at this point to teleport the player (with or without vehicle) use SetPlayerPos or SetVehiclePos


Re: Aanyone know a code for an auto tele - braduz - 31.08.2009

Quote:
Originally Posted by ►☺◄©ookie►☺◄
Quote:
Originally Posted by braduz
ok now where do i put the location to goto the tele and the location the tele sends u too and the text :S
Give me the positions i will give you a script or just contact me (PM, MSN or whatever)

(b.t.w:
pawn Код:
PlayerToPoint(10, playerid, x, y, Z)
will ask if the player is at this point to teleport the player (with or without vehicle) use SetPlayerPos or SetVehiclePos
wow u rock