BanEx

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 10:10, 20 February 2013
Meta (Talk | contribs)
(added german link)
← Previous diff
Revision as of 04:42, 5 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Scripting}} {{Scripting}}
-{{Title}} 
{{Description|Ban a player with a reason.}} {{Description|Ban a player with a reason.}}
Line 33: Line 32:
[[de:BanEx]] [[de:BanEx]]
 +[[fr:BanEx]]
[[nl:BanEx]] [[nl:BanEx]]
[[ru:BanEx]] [[ru:BanEx]]

Revision as of 04:42, 5 February 2014



Description:

Ban a player with a reason.


Parameters:
(playerid,reason[])
playeridThe ID of the player to ban.
reason[]The reason for the ban.


Return Values:

This function does not return any specific values.


public OnPlayerCommandText( playerid, cmdtext[] )
{
    if( strcmp( cmdtext, "/banme", true ) == 0 )
    {
        // Bans the player who executed this command and includes a reason ("Request")
        BanEx( playerid, "Request" );
        return 1;
    }
}

For example, this code would add this line to samp.ban:

127.0.0.1 [15/01/09 | 13:05:23] Name - Request

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • Ban: Ban a player from playing on the server.
  • Kick: Kick a player from the server.