SA-MP Forums Archive
Need Small Help +REP - 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)
+--- Thread: Need Small Help +REP (/showthread.php?tid=391132)



Need Small Help +REP - zohartrejx - 09.11.2012

Hey GUys.

i Need help about IsPlayerInRangePointof...

I Have some Pos, where you need to be, its
2809.5017,-1096.4923,94.1871,91.6790
and i want to make so if your there, it will tp you up to roof,
it gives me error.
Can you please make someone for me like that
You need to be at this pos 2809.5017,-1096.4923,94.1871,91.6790
So you can get tped to 2810.5525,-1092.2820,30.8828,0.5559
+Rep who will help me, thanks.


Re: Need Small Help +REP - Virus. - 09.11.2012

Quote:

if(IsPlayerInRangeOfPoint(playerid,2809.5017,-1096.4923,94.1871,91.6790))
{
SetPlayerPos(playerid,2810.5525,-1092.2820,30.8828,0.5559);
}

this can help u


Re: Need Small Help +REP - Glad2BeHere - 09.11.2012

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/SetPlayerPos

For Example;
pawn Код:
cmd:tele(playerid, params[])
{
 if(IsPlayerInRangeOfPoint(playerid, 2.0,2809.5017,-1096.4923,94.1871))
 {
 SetPlayerPos(playerid, 2810.5525,-1092.2820,30.8828);
 }
 return 1;
}



Re: Need Small Help +REP - Konstantinos - 09.11.2012

Virus, you messed it up. If a player is in range of 2809 meters, lol
+ it will give errors for arguments
pawn Код:
if( IsPlayerInRangeOfPoint( playerid, 5.0, 2809.5017, -1096.4923, 94.1871 ) )
{
    SetPlayerPos( playerid, 2810.5525, -1092.2820, 30.8828 );
}
I also recomment using pickup for this, it's much more cooler than range!


Re: Need Small Help +REP - zohartrejx - 09.11.2012

How you mean Pickup? Anyway thanks for using it, rep


Re: Need Small Help +REP - Konstantinos - 09.11.2012

How to Create a Pickup
You should create a pickup, like an object that when you touch, it can teleport you or what ever you want.


Re: Need Small Help +REP - zohartrejx - 09.11.2012

Doesnt work for me, or i'm doing wrong, could you make it please?


Re: Need Small Help +REP - Alex Magaсa - 09.11.2012

https://sampwiki.blast.hk/wiki/SetSpawnInfo
playerid The PlayerID of who you want to set the spawn information.
team The Team-ID of the chosen player.
skin The skin which the player will spawn with.
Float:X The X-coordinate of the player's spawn position.
Float:Y The Y-coordinate of the player's spawn position.
Float:Z The Z-coordinate of the player's spawn position.
Float:Angle The direction in which the player needs to be facing after spawning.
weapon1 The first spawn-weapon for the player.
weapon1_ammo The amount of ammunition for the primary spawnweapon.
weapon2 The second spawn-weapon for the player.
weapon2_ammo The amount of ammunition for the second spawnweapon.
weapon3 The third spawn-weapon for the player.
weapon3_ammo The amount of ammunition for the third spawnweapon.

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
// This simple example demonstrates how to spawn every player automatically with
    // CJ's skin, which is number 0. The player will spawn in Las Venturas, with
    // 36 Sawnoff-Shotgun rounds and 150 Tec9 rounds.
    
SetSpawnInfoplayerid001958.331343.1215.36269.152636281500);

or
PHP код:
public OnPlayerSpawn(playeridplayerid)
{
SetPlayerPos(playerid,2810.5525,-1092.2820,30.8828);
return 
1;




Re: Need Small Help +REP - Konstantinos - 09.11.2012

pawn Код:
// Global variable
new
    teleport_pickup
;

public OnGameModeInit( )
{
    teleport_pickup = CreatePickup( 1318, 1, 2809.5017, -1096.4923, 94.1871, -1);
    // Rest of your code
    return 1;
}

public OnPlayerPickUpPickup( playerid, pickupid )
{
    if( pickupid == teleport_pickup )
    {
        SetPlayerPos( playerid, 2810.5525, -1092.2820, 30.8828 );
    }
    return 1;
}



Re: Need Small Help +REP - zohartrejx - 10.11.2012

Thanks Guys, You are the best ! Repped