GetPlayerPos
#1

Hey all. I have a question.
When I am on a position I wanna have SendClientMessage(playerid, 0x33AA33AA, "blablabla");
I tought it was something like this:

if(GetPlayerPos(playerid) == 1543.9264,-1675.6503,13.5574,89.0942)
SendClientMessage(playerid, 0x33AA33AA, "blablabla");

But I don't know where to put this in my gamemode or if this is even a good script.
I hope someone will help me.

regards
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerPos
Reply
#3

Quote:
Originally Posted by ray187
Thanks for helping me, but that isn't really what i'm searching for. That shows how to respawn your character from where you disconnected.
I wanna have that if you are on that spot you see a message.
Reply
#4

Nah that shows you how to use GetPlayerPos. Read it once more carefully (disregard the example at first).
Reply
#5

it goes under On‌PlayerUpdate =P
Reply
#6

I`d rather create a function and call that each XX milliseconds as OnPlayerUpdate is called sorta often...
Reply
#7

Quote:
Originally Posted by ray187
Nah that shows you how to use GetPlayerPos. Read it once more carefully (disregard the example at first).
Well. I can't come out :P

public OnPlayerDisconnect(playerid)

I just wanna have it when you are on the position you will get a message, not when you disconncect.
Reply
#8

yea it is actually
Reply
#9

Why dont you use this? https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint :P
Reply
#10

Quote:
Originally Posted by FS}Nameless [LDR
]
yea it is actually
Ok now I have this:
public OnPlayerUpdate(playerid)
{
if(GetPlayerPos(playerid) == 1543.9264,-1675.6503,13.5574,89.0942)
SendClientMessage(playerid, 0x33AA33AA, "blablabla");
return 1;
}


Errors:

C:\Users\Bart\Desktop\SAMP\gamemodes\bartmarc.pwn( 520) : warning 202: number of arguments does not match definition
C:\Users\Bart\Desktop\SAMP\gamemodes\bartmarc.pwn( 520) : warning 202: number of arguments does not match definition
C:\Users\Bart\Desktop\SAMP\gamemodes\bartmarc.pwn( 520) : warning 202: number of arguments does not match definition
C:\Users\Bart\Desktop\SAMP\gamemodes\bartmarc.pwn( 520) : warning 206: redundant test: constant expression is non-zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Warnings.
Reply
#11

I`m trying to tell you the third time now to look up how to use GetPlayerPos properly.

Read what`s below "Parameters:" - disregard the example.

Or use IsPlayerInRangeOfPoint like Fredde suggested.
Reply
#12

Quote:
Originally Posted by ray187
I`m trying to tell you the third time now to look up how to use GetPlayerPos properly.

Read what`s below "Parameters:" - disregard the example.

Or use IsPlayerInRangeOfPoint like Fredde suggested.
It just didn't helped me out.

I wanna have that if you are on a pos it says: /liftup

If someone tells me how that works I will come out.

Maybe someone can give an example?
Reply
#13

pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Reply
#14

Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Alright thankyu.
And is the 7.0 part of the cords or is that the range?
Reply
#15

Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Alright thankyu.
And is the 7.0 part of the cords or is that the range?
The range
Reply
#16

See also: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint ^^
Reply
#17

Quote:
Originally Posted by Fj0rtizFredde
Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Alright thankyu.
And is the 7.0 part of the cords or is that the range?
The range
Thanks it works.But it is spamming like hell xD
Reply
#18

Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Alright thankyu.
And is the 7.0 part of the cords or is that the range?
The range
Thanks it works.But it is spamming like hell xD
It's because the timer :P change it :P
Reply
#19

Quote:
Originally Posted by Fj0rtizFredde
Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
Quote:
Originally Posted by bartje01
Quote:
Originally Posted by Fj0rtizFredde
pawn Код:
//OnGameModeInit:
SetTimer("IceCream",1000, 1);

//Outside any callback:

forward IceCream(playerid);
public IceCream(playerid)

{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1543.9264, -1675.6503, 13.5574))
{
SendClientMessage(playerid,0xFFFFFFFF,"Yeey IceCream!!");
}
return 1;
}
There you go A example of how to use it :P
Alright thankyu.
And is the 7.0 part of the cords or is that the range?
The range
Thanks it works.But it is spamming like hell xD
It's because the timer :P change it :P
Well, It is still spamming, but it is working xD
Reply
#20

Do you want it only to show up once or multiple times in periods?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)