IRC_GetChannelUserList and some issuess
#1

btw

Code:

PHP код:
CMD:ircusers(playeridparams[])
{
    if(
PlayerInfo[playerid][VIP] < 1) return SendClientMessage(playerid, -1""R"[VCL]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
    new 
str[200];
    
IRC_GetChannelUserList(botIDs[0], IRCChannelstrsizeof(str));
    
SendClientMessage(playerid, -1""YE"Online IRC Users:");
    
SendClientMessage(playerid, -1str);
    return 
1;

IRC Users:

17 User in channel :/

Output:

PHP код:
Online IRC Users:
None.
[
0Yassinewat :/ 
any ideas ?
Reply
#2

bump
Reply
#3

Loop through all the connected botIDs (IRC_IsUserConnected) and try it out, Never used IRC so i can't be 100% sure if it's gonna work or not, But it might work.
Reply
#4

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Loop through all the connected botIDs (IRC_IsUserConnected) and try it out, Never used IRC so i can't be 100% sure if it's gonna work or not, But it might work.
ty for reply

but not work :/

it's still give me None.
Reply
#5

Can you show me the code?
Reply
#6

first post

EDIT:
PHP код:
CMD:ircusers(playeridparams[]) 

    if(
PlayerInfo[playerid][VIP] < 1) return SendClientMessage(playerid, -1""R"[VCL]: "GRI"Sorry, This Command can be used just by +Silver Donator's"); 
    new 
str[200]; 
    
IRC_GetChannelUserList(botIDs[0], IRCChannelstrsizeof(str)); 
    
SendClientMessage(playerid, -1""YE"Online IRC Users:"); 
    
SendClientMessage(playerid, -1str); 
    return 
1

Reply
#7

Did you even read my first post?
Reply
#8

Quote:
Originally Posted by Incognito
Посмотреть сообщение
  • IRC_GetChannelUserList(botid, const channel[], dest[], maxlength = sizeof dest);
    • Obtains a space-delimited list of all users in a channel
      Note: This will store every user's name separated by a single space in dest (make sure that the array size is large enough to fit all of the names).
You have used it correctly but until you find out why this happens, I can only suggest a workaround. Have a global variable and:
- increase when a user joins the channel (IRC_OnUserJoinChannel).
- decrease when a user leaves the channel (IRC_OnUserLeaveChannel).

If a player is kicked then IRC_OnUserKickedFromChannel will be called and I'm not sure if IRC_OnUserLeaveChannel will be called too as I haven't used the plugin. If it won't, decrease in this callback as well.
Reply
#9

Quote:

Did you even read my first post ?

yes i do xD

And there just one bot :/ i don't think loop will work

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You have used it correctly but until you find out why this happens, I can only suggest a workaround. Have a global variable and:
- increase when a user joins the channel (IRC_OnUserJoinChannel).
- decrease when a user leaves the channel (IRC_OnUserLeaveChannel).

If a player is kicked then IRC_OnUserKickedFromChannel will be called and I'm not sure if IRC_OnUserLeaveChannel will be called too as I haven't used the plugin. If it won't, decrease in this callback as well.
how i can use this callback and store the users joined ? :/
Reply
#10

Quote:
Originally Posted by Yaa
Посмотреть сообщение
how i can use this callback and store the users joined ? :/




PHP код:
// on top of your script
new IRCUsers;
//callbacks
IRC_OnUserJoinChannel(...)
IRCUsers ++;
IRC_OnUserLeaveChannel(...)
IRCUsers--; 
And you gonna check if IRC_OnUserLeaveChannel is called when a user is kicked from IRC.

Though, in my opinion its not a efficient way, but i've only explained what kons said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)