Ban list?
#1

Well, its simple.

When i /ban someone, it should show up on my website.. How to do that? A pic in attachment.
Reply
#2

a_http include might help?
Reply
#3

Use the website's MySQL server (if it has one) to store the data via a SA-MP MySQL plugin.
You should remove that signature. You could use the space for other interesting things.
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
I'm sorry, I had to reply given your signature!



"it's" has an apostrophe when used as a contraction of "it is", it does not have a apostrophe when used for possession, contrary to the usual rule for possession. If for some reason you are talking about multiple "its" (such as in this sentence) then again there is no apostrophe. Never mind that this sentence has no context and thus "it's" is incorrect and that you started it with "Well".



"I" is always capitalised. "/ban" is the name of a command, and as such is a noun, not a verb. You cannot "/ban" someone, you can ban someone using "/ban", you could use your "/ban" command on someone, but there needs to be an action in the sentence. Sentences should end with only one full stop, there is sometimes a use of three, but not two. The last sentence was just a mess and I have completely rewritten it. Firstly "pic" is an abbreviation so should be "pic.", or simply "picture". Secondly that sentence has an object (the picture in the attachment) but no subject (what about the picture in the attachment)? Even as an object it is wrong and should be something more along the lines of "the picture in the attachment", or "the attached picture".

If you want to be a grammar Nazi, you had better make sure you are perfect, or at least very close! If you wish to rip apart this post feel free, but I am making no claims that it is correct, unlike you.

As for your original problem, how are you banning people and how are you saving that data? Does your website have access to the location in which you are storing that ban data (SQL, Scriptfiles, samp.ban etc)?
Lol'd at the grammar part, the sig is for fun to see how people will react, like you did :P Ill remove the sig so others wont complain

I use 000webhost, and i only got it saving to a file using dini.
Reply
#5

Quote:
Originally Posted by Markx
Посмотреть сообщение
Well, its simple.

When i /ban someone, it should show up on my website.. How to do that? A pic in attachment.
a_http.inc?
Reply
#6

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
a_http.inc?
Any tutorial on how to use it?
Reply
#7

Go to SA:MP wiki, I don't know how to use it, sorry




PS:
This forum requires that you wait 120 seconds between posts. Please try again in 41 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 28 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 18 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 7 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.

lol
Reply
#8

Anyone else maybe?
Reply
#9

You'd need to use some basic PHP and MySQL ( dunno if it's possible with samp.ban )...

Here is just a simple example /ban command saving to a database called "whatever your DB is" and table called "bans" with g-Stlyezzz's MySQL plugin and 3 fields called "nick", "banned" and "bannedreason", also using ZCMD and sscanf:
pawn Код:
CMD:ban( playerid, params[ ] )
{
    new
        id,
        reason[ 128 ]
    ;
    if( sscanf( params, "us[128]", id, reason ) )
        return SendClientMessage( playerid, 0xAAAAAAAA, "USAGE: /ban [ID] [Reason]" );
    if( !IsPlayerConnected( id ) )
        return SendClientMessage( playerid, 0xAAAAAAAA, "Invalid ID" );
    new
        query[ 128 ],
        playername[ 24 ]
    ;
    GetPlayerName( id, playername, 24 );
    format( query, sizeof query, "INSERT INTO `bans` (`nick`, `banned`, `bannedreason`) VALUES (%s, 1, '%s')", playername, reason );
    mysql_query( query );
    return 1;
}

public OnPlayerConnect( playerid )
{
    new
        query[ 128 ],
        playername[ 24 ],
        escplayername[ 24 ]
    ;
    GetPlayerName( playerid, playername, 24 );
    mysql_real_escape_string( playername, escplayername );
    format( query, sizeof query, "SELECT * FROM `bans` WHERE `nick` = '%s'", escplayername );
    mysql_query( query );
    mysql_store_result( );
    if( mysql_num_rows( ) != 0 ) // Ban found
    {
        SendClientMessage( playerid, 0xAAAAAAAA, "Banned from this server! " );
        Kick( playerid );
    }
    mysql_free_result( );
    return 1;
}
Untested^^, just wrote it quickly here.

For PHP, I won't teach u that. Read some MySQL tuts from [HiC]TheKiller, some of them have some PHP stuff.

By the way, ****** is a grammar nazi ?


EDITED: optimized the code, and did it the diffrent way.
Reply
#10

Quote:
Originally Posted by Mean
Посмотреть сообщение
You'd need to use some basic PHP and MySQL ( dunno if it's possible with samp.ban )...

Here is just a simple example /ban command saving to a database called "whatever your DB is" and table called "bans" with g-Stlyezzz's MySQL plugin and 3 fields called "nick", "banned" and "bannedreason", also using ZCMD and sscanf:
pawn Код:
CMD:ban( playerid, params[ ] )
{
    new
        id,
        reason[ 128 ]
    ;
    if( sscanf( params, "us[128]", id, reason ) )
        return SendClientMessage( playerid, 0xAAAAAAAA, "USAGE: /ban [ID] [Reason]" );
    if( !IsPlayerConnected( id ) )
        return SendClientMessage( playerid, 0xAAAAAAAA, "Invalid ID" );
    new
        query[ 128 ],
        playername[ 24 ]
    ;
    GetPlayerName( id, playername, 24 );
    format( query, sizeof query, "INSERT INTO `bans` (`nick`, `banned`, `bannedreason`) VALUES (%s, 1, '%s')", playername, reason );
    mysql_query( query );
    return 1;
}

public OnPlayerConnect( playerid )
{
    new
        query[ 128 ],
        playername[ 24 ],
        escplayername[ 24 ]
    ;
    GetPlayerName( playerid, playername, 24 );
    mysql_real_escape_string( playername, escplayername );
    format( query, sizeof query, "SELECT * FROM `bans` WHERE `nick` = '%s'", escplayername );
    mysql_query( query );
    mysql_store_result( );
    new line[ 750 ]; // I know it's unoptimized :|
    if( mysql_fetch_row( line ) )
    {
        new banned;
        sscanf( line, "p<|>d", banned );
        SetPVarInt( playerid, "Banned", banned );
    }
    if( GetPVarInt( playerid, "Banned" ) == 1 )
    {
        SendClientMessage( playerid, 0xAAAAAAAA, "Banned from this server! " );
        Kick( playerid );
    }
    return 1;
}
Untested^^.

For PHP, I won't teach u that.

By the way, ****** is a grammar nazi ?
Thanks, i will try to make it with MySQL then, will be a bit hard BTW, when i buy SA-MP server hosting, theres also a MySQL in the controll panel. Is that the MySQL that i should get the data, username, pass etc... ? Because i use wamp atm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)