Two questions about playerid definitions - 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: Two questions about playerid definitions (
/showthread.php?tid=228516)
Two questions about playerid definitions -
Zack9764 - 19.02.2011
How do I define everyone in a specific vehicle as a playerid?
How do I define everyone on the server as a playerid?
Re: Two questions about playerid definitions -
PowerPC603 - 19.02.2011
I don't know what you mean.
As soon as a player logs in, he is given a playerid, so you can use his id as a reference to that player.
You cannot force a playerid on somebody.
Re: Two questions about playerid definitions -
xRyder - 19.02.2011
Yeah, you can't actually change players ID. But you can set his id in multidimenisonal array and then use it as a group.
Re: Two questions about playerid definitions -
Zack9764 - 20.02.2011
No I mean like, say I wanted to do SendClientMessage to everyone. I would have to do SendClientMessage(playerid, blah blah blah); I want everyone on the server to be classified as that playerid.
(I KNOW there is SendClientMessageToAll, but this is an EXAMPLE)
Re: Two questions about playerid definitions -
admantis - 20.02.2011
Than use loops.
pawn Код:
for (new all = 0; all < MAX_PLAYERS; all ++) {
SendClientMessage(all,0xFFFFFFAA,"Test message to all."); }
// Or faster foreach
foreach (Player, all) {
SendClientMessage(all,0xFFFFFFAA,"Test message to all."); }
Regards.
Re: Two questions about playerid definitions -
Zack9764 - 20.02.2011
Perfect. And how can I do the same, except only for the players in a certain vehicle?
Re: Two questions about playerid definitions -
Marricio - 20.02.2011
do a loop, and check if the player is in a certain vehicle.
Re: Two questions about playerid definitions -
jameskmonger - 20.02.2011
pawn Код:
foreach (Player, all) if(isinvehicle) sendmessage