Jump to content
MakeWebGames

Ban Hook


Galahad

Recommended Posts

This hook disables a banned players ability to play the game.

Run this query first -

ALTER TABLE players ADD ban int(2) NOT NULL DEFAULT 0

 

then make a hook called ban.php and add this in it ->

/hooks/ban.php

<?php
defined('IN_EZRPG') or exit;
//Made by 21lockdown
//http://www.ezrpgproject.com/forum/
$hooks->add_hook('header', 'ban');

function hook_ban($db, $tpl, $player, $args = 0)
{
   if ($player === 0 || LOGGED_IN == false)
       return $args;

	    if ($player->ban == 1)
   {
die ("You have been banned from the server!");
   }

   return $args;
}
?>

 

Now to ban a player. Simply set the users "ban" field to 1.

Edited by 21Lockdown
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...