SA-MP Forums Archive
IRC Help ! To give Permission - 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 Help ! To give Permission (/showthread.php?tid=599619)



IRC Help ! Command PM On IRC - Amunra - 28.01.2016

Hi,
I Want to Make IRCCMD / With Include irc.inc,
So I Want to Make PM command on IRC How to create thats ?


Re: IRC Help ! To give Permission - Sew_Sumi - 28.01.2016

The scripts instructions for the plugin explain a lot. ****** can show some more.

Should only use authenticated users from IRC for chatting otherwise someone could just join and spam.


Re: IRC Help ! To give Permission - Amunra - 28.01.2016

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
The scripts instructions for the plugin explain a lot. ****** can show some more.

Should only use authenticated users from IRC for chatting otherwise someone could just join and spam.
In Any IRC Server .. The Guest can Send Message to Server


Re: IRC Help ! To give Permission - JeaSon - 28.01.2016

can you show us your !say cmd ?


Re: IRC Help ! To give Permission - Amunra - 28.01.2016

Quote:
Originally Posted by JeaSon
Посмотреть сообщение
can you show us your !say cmd ?
Solved With Say command !

My problem now is , PM Command / How to make thats ?


Re: IRC Help ! To give Permission - Sew_Sumi - 28.01.2016

Show your say command, then at least someone may be able to copy and paste you a solution, but really, this isn't what Scripting Help is for.


Re: IRC Help ! To give Permission - Riddy - 28.01.2016

Код:
IRCCMD:pm(botid, channel[], user[], host[], params[]) {
	
	new userid, message[119], string[128];
	if(sscanf(params, "us", userid, message)) return 0; // Return a message here using IRC_Say, this checks whether the parameters are filled

	if(!IsPlayerConnected(userid)) return 0; // Return a message here using IRC_Say, this checks whether a user is connected or not

	if(strlen(message) > 118) return 0; // Return a message using IRC_Say (Ensures the maximum amount of characters has not been reached)

	/* 
		The string length is 118 because if a user has 9 characters in their name on the irc, and the message reaches all of the string length
	   	it will cut it off at the end because it can not show more than 128 characters at once.
	*/  

	format(string, sizeof(string), "%s: %s", user, message);
	SendClientMessage(userid, 0xFFFFFF, string);

	// Use IRC_Say to inform the user about the successfully sent message, example:
	IRC_Say(botid, user, "Successfully sent a PM!");
	return 1;
}
I probably made a few mistakes in this, my bad if so. But, afaik, that's what you want.

EDIT: I forgot to add:

Код:
if(!IRC_IsVoice(botid, channel, user)) return 0; // This can be used to check if the user has voice in the server, if the user does not have voice then they can not use the command