SA-MP Forums Archive
Playerid = float or?. - 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: Playerid = float or?. (/showthread.php?tid=238510)



Playerid = float or?. - [BKR]LUCAGRABACR - 11.03.2011

I want to make a dynamiccp shows only to one player.

But I want and need to get his id for this.

Is playerid = float like x y z positions? Or?.

If so can I use setpvar smthing and then getpvar smthing for floats to playerid?.


Re: Playerid = float or?. - Hashski - 11.03.2011

Its not a Float.


Re: Playerid = float or?. - Calgon - 11.03.2011

playerid is an integer. If you want to use PVars to retain floats, use SetPVarFloat(playerid, "<varname>", <floatvar>);


Re: Playerid = float or?. - [BKR]LUCAGRABACR - 11.03.2011

Hmm..

Is there any kind of..

For example..
pawn Код:
GetPlayerID(playerid);
GetPVarFloat(playerid,"a",playerid);
So then for example I can
pawn Код:
SetPlayerHealth(GetPVarFloat("a"), 100);

Or?.

Well, you can say I want to retain playerid with PVar.

Or is there any other way to retain a playerid?.

Because in Incognito streamer if I'm using "-1" in one of the "CreateDynamicCP" argument the checkpoint will shows to all players, so I'm trying to make it visible to 1 player only.


AW: Playerid = float or?. - Nero_3D - 12.03.2011

The better question is where do you want to get playerid ? In which callback ?


Re: Playerid = float or?. - [BKR]LUCAGRABACR - 12.03.2011

In this:

CreateDynamicCP.

I think it has playerid in it, right?.


AW: Playerid = float or?. - Nero_3D - 12.03.2011

So you use Incognito's plugin

lets check his streamer.inc (pawno\include\)
Quote:
Originally Posted by streamer.inc
native CreateDynamicCP(Float: x, Float:y, Float:z, Float: size, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 100.0);
Yes it has a playerid parameter

But if you want to use it you need to go under a callback (public) that provides the playerid
Like OnPlayerSpawn, OnPlayerConnect, OnPlayerRequestClass, ...


Re: Playerid = float or?. - OKStyle - 12.03.2011

You can use playerid, or any integer (from 0 to MAX_PLAYERS) like: SetPlayerHealth(50,100.0); - heal only id 50.


Re: Playerid = float or?. - MP2 - 12.03.2011

Quote:
Originally Posted by [BKR]LUCAGRABACR
Посмотреть сообщение
Hmm..
GetPlayerID(playerid);
Why would you want to get the ID of a player if you already have it? GetPLAYERID(PLAYERID) - doesn't make sense at all.