Two questions about playerid definitions
#1

How do I define everyone in a specific vehicle as a playerid?
How do I define everyone on the server as a playerid?
Reply
#2

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

Yeah, you can't actually change players ID. But you can set his id in multidimenisonal array and then use it as a group.
Reply
#4

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

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

Perfect. And how can I do the same, except only for the players in a certain vehicle?
Reply
#7

do a loop, and check if the player is in a certain vehicle.
Reply
#8

pawn Код:
foreach (Player, all) if(isinvehicle) sendmessage
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)