Need Small Help +REP
#1

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

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

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;
}
Reply
#4

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

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

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

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

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;

Reply
#9

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;
}
Reply
#10

Thanks Guys, You are the best ! Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)