instead of playerid, allplayers?
#1

So you have SendClientMessage(playerid, -1, "Hello");
Cant I do something like SendClientMessage(allplayers, -1, "Hello");
I know i could SendClientMessageToAll(-1, "Hello");
But I just need to know if i could do it that way
Reply
#2

Loops.
Reply
#3

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Loops.
Example?
Reply
#4

pawn Код:
for( new i; i < MAX_PLAYERS; i++ )
{
    // Checking if he's connected, etc.
   SendClientMessage(i, -1, "Message");
}
But anyways, it's obviously slower than SendClientMessageToAll.
Reply
#5

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
pawn Код:
for( new i; i < MAX_PLAYERS; i++ )
{
    // Checking if he's connected, etc.
   SendClientMessage(i, -1, "Message");
}
But anyways, it's obviously slower than SendClientMessageToAll.
I know but i want to use it to set skins and stuff, thanks !
Reply
#6

Has everyone forgotten about SendClientMessageToAll?
Reply
#7

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
pawn Код:
for( new i; i < MAX_PLAYERS; i++ )
{
    // Checking if he's connected, etc.
   SendClientMessage(i, -1, "Message");
}
But anyways, it's obviously slower than SendClientMessageToAll.
Quote:
Originally Posted by MP2
Посмотреть сообщение
Has everyone forgotten about SendClientMessageToAll?
No, we haven't!
Reply
#8

https://sampwiki.blast.hk/wiki/Function:...ntMessageToAll
Reply
#9

SendClientMessageToAll is used to send to all players where = 'playerid' parameter does not exist,
but when you make loops, you can make a specified condition , for example if players are vips
I recomand foreach,
Код:
    foreach(Player,i)
    {
             if(PlayerInfo[i][Vip] < 1)
             {
                  SendClientMessage(playerid,COLOR_BLUE,"Hey vips!");
             }
    }
but you can also do that with the normal loop
Код:
   for(new i = 0; i < MAX_PLAYERS;i++)
   {
        //comment here
   }
Anyway good luck
Reply
#10

Why would you use '< 1' there? Surely it's either 0 or 1 - it's never going to be negative. I'm fairly certain < and > are slower than == or !=.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)