• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] samp-advanced-kicks
#1
samp-delayed-kick

[Image: sampctl-samp--advanced--kick-2f2f2f.svg?...-the-badge]


 Installation

Simply install to your project:

Code:
sampctl package install Mergevos/samp-advanced-kick

Include in your code and begin using the library:

Code:
#include <m_kicks>

Usage

To use this include, simply include it. There's no need for fixing kick and SendClientMessage(etc...) due to its problems.
There're a few functions. 
Code:
Kick(playerid)
Very famous function, already known.
Code:
KickEx(playerid, string: reason[], bool:usecallback=false)  
 
Sister function of famous Kick. You may now kick with reason, that's going to be send like a message  
Code:
AdvancedKick(playerid, targetid, string: reason[], time);  
This function will check whether the playerid or targetid are connected, returning a `OnPlayerKicked` callback. Allowing you to choose interval after which will player get kicked.  
Code:
public OnlayerKicked(playerid, kickerid, string: reason[], time, responselevel)
Allows player to choose and create their own response if the either player or target's not connected  

Code:
enum {
    KICK_SUCCESS = 1, // Kick's successful  
    KICK_KICKEROFFLINE, // Player offline, target id not player id  
    KICK_TARGETOFFLINE // Target offline, player id not kicker id  
}
Theese're the response levels used by a responselevel param in OnPlayerKicked callback


Testing

To test, simply run the package:

Code:
sampctl package run


Other

I don't know why I've just had published this
  Reply
#2
Code:
// --
// <summary>Forwards callback OnPlayerKicked</summary>
// --

Oh no @Jamie

EDIT: This include is generally useless as there are MANY better ways of delaying connection closing. (also 70ms here is insufficient here)
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
(2020-07-30, 10:09 PM)Pinch Wrote:
Code:
// --
// <summary>Forwards callback OnPlayerKicked</summary>
// --

EDIT: This include is generally useless as there are MANY better ways of delaying connection closing. (also 70ms here is insufficient here)

Da u pravu si momcino.
Many better ways, like GetTickCount, GetTime etc...there are more efficient ways to do this excatly. Thank you, I'll do that, ba? kao ?to si mi rekao ;)
EDIT: Forgot, you've said it's insufficient? Sure?
  Reply
#4
(2020-08-01, 12:41 PM)Mergevos Wrote:
(2020-07-30, 10:09 PM)Pinch Wrote:
Code:
// --

// <summary>Forwards callback OnPlayerKicked</summary>

// --



EDIT: This include is generally useless as there are MANY better ways of delaying connection closing. (also 70ms here is insufficient here)



Da u pravu si momcino.

Many better ways, like GetTickCount, GetTime etc...there are more efficient ways to do this excatly. Thank you, I'll do that, ba? kao ?to si mi rekao ;)

EDIT: Forgot, you've said it's insufficient? Sure?



I am sure as in real-time player's ping can be much higher than 70ms ;D
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#5
(2020-08-01, 04:42 PM)Pinch Wrote:
(2020-08-01, 12:41 PM)Mergevos Wrote:
(2020-07-30, 10:09 PM)Pinch Wrote:
Code:
// --

// <summary>Forwards callback OnPlayerKicked</summary>

// --



EDIT: This include is generally useless as there are MANY better ways of delaying connection closing. (also 70ms here is insufficient here)



Da u pravu si momcino.

Many better ways, like GetTickCount, GetTime etc...there are more efficient ways to do this excatly. Thank you, I'll do that, ba? kao ?to si mi rekao ;)

EDIT: Forgot, you've said it's insufficient? Sure?



I am sure as in real-time player's ping can be much higher than 70ms ;D



Ah, okay, you could suggest me more ways thus I can implement into this lib lepi moj
  Reply


Forum Jump: