SA-MP Forums Archive
IRC_GetChannelUserList and some issuess - 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)
+--- Thread: IRC_GetChannelUserList and some issuess (/showthread.php?tid=625589)



IRC_GetChannelUserList and some issuess - Yaa - 03.01.2017

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 ?


Re: IRC_GetChannelUserList and some issuess - Yaa - 04.01.2017

bump


Re: IRC_GetChannelUserList and some issuess - oMa37 - 04.01.2017

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.


Re: IRC_GetChannelUserList and some issuess - Yaa - 04.01.2017

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.


Re: IRC_GetChannelUserList and some issuess - oMa37 - 04.01.2017

Can you show me the code?


Re: IRC_GetChannelUserList and some issuess - Yaa - 04.01.2017

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




Re: IRC_GetChannelUserList and some issuess - oMa37 - 04.01.2017

Did you even read my first post?


Re: IRC_GetChannelUserList and some issuess - Konstantinos - 04.01.2017

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.


Re: IRC_GetChannelUserList and some issuess - Yaa - 04.01.2017

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 ? :/


Re: IRC_GetChannelUserList and some issuess - iLearner - 06.01.2017

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.