Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Libraries [Library] samp-advanced-kicks

 
  • 0 Vote(s) - 0 Average
Library samp-advanced-kicks
Mergevos
Offline

Burgershot Member
Posts: 12
Threads: 8
Joined: Jul 2020
Reputation: 0
#1
2020-07-27, 12:24 AM
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
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#2
2020-07-30, 10:09 PM (This post was last modified: 2020-07-30, 10:11 PM by Pinch.)
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.
Mergevos
Offline

Burgershot Member
Posts: 12
Threads: 8
Joined: Jul 2020
Reputation: 0
#3
2020-08-01, 12:41 PM (This post was last modified: 2020-08-01, 03:08 PM by Mergevos.)
(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 momčino.
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?
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2020-08-01, 04:42 PM
(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 momčino.
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.
Mergevos
Offline

Burgershot Member
Posts: 12
Threads: 8
Joined: Jul 2020
Reputation: 0
#5
2020-08-01, 05:26 PM
(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 momčino.
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
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode