SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/12/2013, 04:15 PM   #1
SplinteX
Big Clucker
 
Join Date: Dec 2013
Posts: 94
Reputation: 4
Default When player connect (if banned) shows dialog that he is banned!

Hello!

I wanna ask how to make that when some banned player join my server it opens a dialog box that he is banned (reason,IP...) and then Server closed the connection.

Like this:

__________________
San Fierro Cops and Robbers



SFCnR Forum
SplinteX is offline   Reply With Quote
Old 22/12/2013, 04:29 PM   #2
erminpr0
Huge Clucker
 
erminpr0's Avatar
 
Join Date: Jan 2013
Posts: 222
Reputation: 22
Default Re: When player connect (if banned) shows dialog that he is banned!

pawn Code:
new bool: Banned[MAX_PLAYERS char];
CMD:ban(playerid, params[])
{
    if(!isnull(params)) Banned[params] = true;
    return 1;
}

OnPlayerConnect(playerid)
{
    if(Banned[playerid])
    {
        SendClientMessage(playerid, -1, " You are banned ! ");
        return Kick(playerid);
    }
}

Make your own ban command, this is example, if you don't understand I'll make it later !
erminpr0 is offline   Reply With Quote
Old 22/12/2013, 04:35 PM   #3
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,863
Reputation: 1399
Default Re: When player connect (if banned) shows dialog that he is banned!

Quote:
Originally Posted by erminpr0 View Post
pawn Code:
new bool: Banned[MAX_PLAYERS char];
CMD:ban(playerid, params[])
{
    if(!isnull(params)) Banned[params] = true;
    return 1;
}

OnPlayerConnect(playerid)
{
    if(Banned[playerid])
    {
        SendClientMessage(playerid, -1, " You are banned ! ");
        return Kick(playerid);
    }
}

Make your own ban command, this is example, if you don't understand I'll make it later !
Use char keyword only if you know how to use it.

The declaration is fine but the rest are not:
pawn Code:
Banned[params] = true;
params is an array and it expects an integer value instead. Also it must be used with {} and not with []. So this:
pawn Code:
if(Banned[playerid])
becomes:
pawn Code:
if(Banned{playerid})

But still.. you need a ban system that will assign whether the player is banned to the variable and act accordingly. There are many filterscripts/tutorials/includes that does what SplinteX wants, just search!
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos 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
Player banned problem Raphy Scripting Help 2 21/05/2013 11:43 AM
Banned Connect Message kbalor Scripting Help 9 27/08/2012 06:03 PM
Get player banned reason MarinacMrcina Scripting Help 10 20/06/2012 04:46 AM
If player is banned Kingunit Help Archive 12 08/08/2011 02:02 AM
Bug - Can't connect...retries...it says im banned from a server External-Life Client Support 3 09/11/2009 10:22 AM


All times are GMT. The time now is 07:13 AM.


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