[Include] newkb.inc -> Kick and ban functions extension
#4

Quote:
Originally Posted by SchurmanCQC
Посмотреть сообщение
This is cool but I hate the way you decided to use only 1 function. Trying to figure out what parameters should be used is hard as fuck.

You should really consider keeping the one function with the long string of parameters and also creating more which do the same thing and are easier to understand.

Also, the Client function is not a native. You had me fooled for a moment into thinking this also contained a plugin.
Well, I know it may be too hard to learn and understand, but the point of this function was to enable scripter using multiple and different parameters! Also, making this function with optional parameters instead of arguments would require to create one more extra function because when you use message type notification, it needs 2 parameters (actual message and color) and when you use dialog type notification, it requires 3 parameters (caption, info and button)! Though, this indeed can be made with option parameters, e.g.:

pawn Код:
Client(CLIENT_ACTION_KICK, playerid, NOTIFICATION_TYPE_MSG, "You are kicked from the server!", 0xFF0000, 0, 0, 0);
where 0's are those parts for the dialog style notification (well, they are actually strings so I can't use integrers, but this is just example)! On the other hand, using dialog style nofitication would look something like this:

pawn Код:
Client(CLIENT_ACTION_KICK, playerid, NOTIFICATION_TYPE_DIALOG, 0, 0, "KICKED!", "You are kicked from the server!", "Close");
where 0's are parameters for message style notification!

Then, if you want to for example kick all players, you would have to do this:

pawn Код:
Client(CLIENT_ACTION_KICK, 0, 0, 0, 0, 0, 0, 0);
where 0's represent all other optional parameters! I didn't like this look of function, thats why I did it with arguments!


So, if you do understand and learn how this function works, it should be easy to use it! (those upper-posted examples are somewhere near what you meant, right?)

About the name - I simply couldn't think of better one so I used "Client"! :P

Any constructive and positive criticism/comments are welcome!

Regards!
Reply


Messages In This Thread
newkb.inc -> Kick and ban functions extension - by fiki574 - 09.04.2013, 17:00
Re: newkb.inc -> Kick and ban functions extension - by fiki574 - 10.04.2013, 13:01
Re: newkb.inc -> Kick and ban functions extension - by SchurmanCQC - 10.04.2013, 13:09
Re: newkb.inc -> Kick and ban functions extension - by fiki574 - 10.04.2013, 13:17
Re: newkb.inc -> Kick and ban functions extension - by Niko_boy - 10.04.2013, 13:22
Re: newkb.inc -> Kick and ban functions extension - by greentarch - 10.04.2013, 13:42
Re: newkb.inc -> Kick and ban functions extension - by fiki574 - 10.04.2013, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)