open.mp forum
[Library] samp-advanced-kicks - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Releases (https://forum.open.mp/forumdisplay.php?fid=13)
---- Forum: Libraries (https://forum.open.mp/forumdisplay.php?fid=31)
---- Thread: [Library] samp-advanced-kicks (/showthread.php?tid=1150)



samp-advanced-kicks - Mergevos - 2020-07-27

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



RE: samp-advanced-kicks - Pinch - 2020-07-30

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)


RE: samp-advanced-kicks - Mergevos - 2020-08-01

(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?


RE: samp-advanced-kicks - Pinch - 2020-08-01

(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


RE: samp-advanced-kicks - Mergevos - 2020-08-01

(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