[Include] SDMessage [Includes: Kick, Ban, BanEx, Reconnect, ToggleDialogMessage]
#1

SDMessage include 1.1
Created by:
Biesmen


About
I was bored at my 'school' and I thought of creating something which looks nice, but is pretty useless. It's just something for the layout of the server. This includes sends a normal dialog to players who get Kicked, Banned or forced to reconnect. If a player gets kicked, it will send this dialog: "You've been kicked by the server", however you can give a reason by using this code: "Kick(playerid, "Insulting");". It will send this dialog: "You've been kicked by the server for: Insulting". I've also included a reconnect function, which is scripted by me and thought by JernejL.

Functions:
pawn Код:
Kick(playerid, reason); // If you do not want to give a reason, you can use the normal Kick(playerid); !
Ban(playerid); // Normal ban, not changed, it only sends a dialog message.
BanEx(playerid, reason, name); // Normal BanEx. If you do not want to enter the name of the admin, you can just use BanEx(playerid, reason);
Reconnect(playerid, reason); // Same as above. It will send "You've got forced to reconnect by the server" if you do not enter a reason. Use Reconnect(playerid); if you do not want to give a reason.
ToggleDialogMessage(type, bool:true/false); // This function will disable the dialog message for the chosen type. Existing types: Kick, Ban, BanEx, Reconnect
How-to-use
Copy the pastebin link at the "Download" section, open notepad, paste the script and save it as "SDMessage.inc" in your /pawno/include folder. Enter this at the top of your script, below #include <a_samp>
pawn Код:
#include <SDMessage>
Download
Pastebin Version: 1.1 - NEW
Pastebin Version: 1.0
No mirrors allowed

Known bugs
-

Credits
  • Biesmen
  • JernejL - Reconnect method
  • KoczkaHUN - The method to make the functions work without modifying your script.
Feedback and critism allowed.
Enjoy
Reply
#2

Very Nice I Love It!

BTW 1st =D
Reply
#3

Quote:

If you do not want to give a reason, replace it with this: Kick(playerid, "");

Instead of replacing with "" if you don't have a reason you can check if the string is empity so you will use only Kick(playerid);

But anyways good job.
Reply
#4

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Instead of replacing with "" if you don't have a reason you can check if the string is empity so you will use only Kick(playerid);
There are still some couple of things I have to learn, and that's one of them. I am trying to get that working for a long time, but never managed to. However, now I've got the time, I will add this in version 2.0 for sure.
Reply
#5

Just replace
pawn Код:
KickEx(playerid, reason[])
with
pawn Код:
KickEx(playerid, reason[]="")
, and you won't break current scripts.
Reply
#6

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
Just replace
pawn Код:
KickEx(playerid, reason[])
with
pawn Код:
KickEx(playerid, reason[]="")
, and you won't break current scripts.
Thank you very much, I'll update the script right now.
Reply
#7

Nicee
Reply
#8

Version 1.1 released, if you have 1.0, replace it.
Adds in 1.1
Kick and BanEx is now compatible with every script. You do not have to change your script anymore if you do not want to give a Kick reason, or if you do not want to enter a name at BanEx.
(Thanks to KoczkaHUN)
Reply
#9

nice wwork...i'm lov'in it..keep it up dude...exellant !
Reply
#10

How do I install this because when I add #include <SDMessage> to my gamemode and the file to /pawno/include it says: 'Cannot read from file: SDMessage.inc '
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)