SA-MP Forums Archive
GetPlayerPos - 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: GetPlayerPos (/showthread.php?tid=124772)

Pages: 1 2


GetPlayerPos - bartje01 - 31.01.2010

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


Re: GetPlayerPos - ray187 - 31.01.2010

https://sampwiki.blast.hk/wiki/GetPlayerPos


Re: GetPlayerPos - bartje01 - 31.01.2010

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.


Re: GetPlayerPos - ray187 - 31.01.2010

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


Re: GetPlayerPos - fsnameless - 31.01.2010

it goes under On‌PlayerUpdate =P


Re: GetPlayerPos - ray187 - 31.01.2010

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


Re: GetPlayerPos - bartje01 - 31.01.2010

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.


Re: GetPlayerPos - fsnameless - 31.01.2010

yea it is actually


Re: GetPlayerPos - Fj0rtizFredde - 31.01.2010

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


Re: GetPlayerPos - bartje01 - 31.01.2010

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.



Re: GetPlayerPos - ray187 - 31.01.2010

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.


Re: GetPlayerPos - bartje01 - 31.01.2010

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?


Re: GetPlayerPos - Fj0rtizFredde - 31.01.2010

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


Re: GetPlayerPos - bartje01 - 31.01.2010

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?


Re: GetPlayerPos - Fj0rtizFredde - 31.01.2010

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


Re: GetPlayerPos - ray187 - 31.01.2010

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


Re: GetPlayerPos - bartje01 - 31.01.2010

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


Re: GetPlayerPos - Fj0rtizFredde - 31.01.2010

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


Re: GetPlayerPos - bartje01 - 31.01.2010

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


Re: GetPlayerPos - ray187 - 31.01.2010

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