How to target everyuser in the game?
#1

Title says all, it's for a noob system, only for those who have allowed themselves to view the noob messages.
Reply
#2

I still can't understand what exactly you need?
Reply
#3

Loop through all players, check if they allow that messages, and if so, send them that message. Shouldnt be that hard at all.
Example:

pawn Код:
for (new i = 0; i < MAX_PLAYERS; i++) {
    if (!IsPlayerConnected(i) || !noobMode[i]) continue;
    SendClientMessage(i, color, message);
}
Reply
#4

pawn Код:
new allownoobmessages[MAX_PLAYERS]

//OnPlayerConnect
allownoobmessages[playerid] = 1;

CMD:allownoobmessage( playerid, params[] )
// bracket goes here, sorry i dont have it in my keyboard
     if( allownoobmessages[playerid] == 1 )
         allownoobmessages[playerid] = 0;
     else
          allownoobmessages[playerid] = 1;
     return 1;
// closing bracket


stock SendNoobMessage( color, string[] )
// bracket
    for( new i = 0; i!=MAX_PLAYERS;i++ )
        if( allownoobmessages[i] == 1 && IsPlayerConnected( playerid ) )
            SendClientMessage( playerid, color, string );
     return 1;
// closing bracket
Sorry for identation and all, i dont have PAWNO in this computer, either can do brackets.

Note you need to reset the variable when a player disconnects, this is just a snippet, you can do the noob chat command yourself with it.
Reply
#5

I love that guys asking a question and then never coming back when its answered.
Reply
#6

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
I love that guys asking a question and then never coming back when its answered.
I live the guy that comments without actually helping just so that he can make a point, not my fault I haven't had spare time recently
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)