SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 28/07/2020, 10:46 AM   #1
Mergevos
Little Clucker
 
Join Date: Jul 2020
Posts: 11
Reputation: 0
Default Samp Advanced Kicks | Kick with reason | Kick with delay

samp-delayed-kick




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

Last edited by Mergevos; 28/07/2020 at 11:05 PM.
Mergevos is offline   Reply With Quote
Old 28/07/2020, 02:04 PM   #2
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 923
Reputation: 89
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

So let me understand, i have to install sampctl, download your script where i don't see the source (or am I blind?) and add your include while I can simply do:

pawn Code:
DelayedKick(playerid)
{
    SetTimerEx("KickPlayerDelayed", 10 + GetPlayerPing(playerid), false, "d", playerid);
    return 1;
}

public KickPlayerDelayed(playerid)
{
    Kick(playerid);
    return 1;
}
Symon is offline   Reply With Quote
Old 28/07/2020, 04:55 PM   #3
Fairuz
Huge Clucker
 
Fairuz's Avatar
 
Join Date: Sep 2015
Location: Indonesia
Posts: 455
Reputation: 78
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

What? I don't see any reason making an include for this, you can simply set timer just like Symon posted.
Anyway, your repo has extra word 's', so it should be. Mergevos/samp-advanced-kicks
__________________
Los Santos based Cops and Robbers with many features.
209.58.183.101:7777
Fairuz is offline   Reply With Quote
Old 28/07/2020, 11:10 PM   #4
Mergevos
Little Clucker
 
Join Date: Jul 2020
Posts: 11
Reputation: 0
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Symon View Post
So let me understand, i have to install sampctl, download your script where i don't see the source (or am I blind?) and add your include while I can simply do:
Yes, you have to use sampctl, it's 2020.

And yes, you can simply DO your own function, and, thus, why don't you do it for every include? Why don't do everything by yourself? Why don't do the whole YSI package yourself? You've a fixed Kick, so you don't have to use FUNCTIONS LIKE DELAYEDKICK instead of Kick, with two extra functions and one callback, ah this forum isn't like it was before.
Mergevos is offline   Reply With Quote
Old 28/07/2020, 11:48 PM   #5
Mergevos
Little Clucker
 
Join Date: Jul 2020
Posts: 11
Reputation: 0
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Fairuz View Post
What? I don't see any reason making an include for this, you can simply set timer just like Symon posted.
Anyway, your repo has extra word 's', so it should be. Mergevos/samp-advanced-kicks
"I don't see any reason", from this 3-4 years of my pawn experience, I've seen a bunch of same code, made differently in every gamemode, and 90% of them uses a function like delayedkick like in the code above. People probably do not know how much code they've. As an example, you can look through all the folders of YSI. There are the includes like, y_vehicledata, with vehicle type checking, and instead of using finished code, people act like they're ashamed of using another man code, then create their own functions, that's exactly same like that's one in particular include
Mergevos is offline   Reply With Quote
Old 29/07/2020, 02:37 AM   #6
Symon
Gangsta
 
Symon's Avatar
 
Join Date: Apr 2019
Location: Italy
Posts: 923
Reputation: 89
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Mergevos View Post
Yes, you have to use sampctl, it's 2020.
You misunderstood me. I meant there's no reason to use sampctl for such a simple include. I'd use it for bigger scripts (like modular gamemodes) where you can enjoy sampctl at its maximum power.

Quote:
Originally Posted by Mergevos View Post
ah this forum isn't like it was before
Yeah, unluckily...
Symon is offline   Reply With Quote
Old 29/07/2020, 08:43 AM   #7
Mergevos
Little Clucker
 
Join Date: Jul 2020
Posts: 11
Reputation: 0
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Symon View Post
You misunderstood me. I meant there's no reason to use sampctl for such a simple include. I'd use it for bigger scripts (like modular gamemodes) where you can enjoy sampctl at its maximum power.
Aha, aha, I got you. But there's not a rule about script size and using sampctl, or maybe I haven't found it? Using sampctl don't have to be limited on your script size. There's a lot of people using it on their small dm/fr scripts. And there's one line that's exactly "sampctl p install Mergevos/samp-advanced-kicks", allowing you to use kick as fixed function, without making a new function Njanjanja_Kick(playerid), whatever. That's the point, allowing developers to solve problems with bigger things, not with simple native racing
Mergevos is offline   Reply With Quote
Old 01/08/2020, 05:32 AM   #8
cosinus
Little Clucker
 
Join Date: Apr 2020
Location: Indonesia
Posts: 17
Reputation: 7
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Symon View Post
You misunderstood me. I meant there's no reason to use sampctl for such a simple include. I'd use it for bigger scripts (like modular gamemodes) where you can enjoy sampctl at its maximum power.



Yeah, unluckily...
You are freely to use sampctl even in the small things. I thought you don't know modular programming is.
cosinus is offline   Reply With Quote
Old 01/08/2020, 08:18 AM   #9
brauf
Little Clucker
 
brauf's Avatar
 
Join Date: Jul 2018
Location: i live in narnia city Savage: 100%
Posts: 37
Reputation: 29
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

Quote:
Originally Posted by Symon View Post
So let me understand, i have to install sampctl, download your script where i don't see the source (or am I blind?) and add your include while I can simply do:

......
leads to https://github.com/Mergevos/samp-advanced-kicks



Quote:
Originally Posted by Symon View Post
You misunderstood me. I meant there's no reason to use sampctl for such a simple include. I'd use it for
bigger scripts (like modular gamemodes) where you can enjoy sampctl at its maximum power.



Yeah, unluckily...

Last edited by brauf; 01/08/2020 at 08:48 AM.
brauf is offline   Reply With Quote
Old 03/08/2020, 08:13 PM   #10
Mergevos
Little Clucker
 
Join Date: Jul 2020
Posts: 11
Reputation: 0
Default Re: Samp Advanced Kicks | Kick with reason | Kick with delay

This guy's god
Mergevos is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kick delay and message not working. TheLittleFucker Scripting Help 2 02/06/2020 11:05 AM
Delay kick question Leaky Scripting Help 6 06/02/2019 08:35 PM
How can I add a delay to my kick? lramos15 Scripting Help 7 08/06/2013 01:11 AM
Ban/kick reason Louris Scripting Help 3 12/02/2013 12:42 PM


All times are GMT. The time now is 07:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.