-
Notifications
You must be signed in to change notification settings - Fork 2
/
uninstall.php
37 lines (27 loc) · 1.23 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
global $db, $table_prefix;
define("TABLE_OVERSIGHT", $table_prefix . "oversight");
define("TABLE_OVERSIGHT_PLAYERS", $table_prefix . "oversight_players");
define("TABLE_XTENSE_CALLBACKS", $table_prefix."xtense_callbacks");
// On récupère l'id du mod pour xtense...
$query = "SELECT id FROM ".TABLE_MOD." WHERE action='oversight'";
$result = $db->sql_query($query);
list($mod_id) = $db->sql_fetch_row($result);
// On regarde si la table xtense_callbacks existe :
$query = 'SHOW TABLES LIKE "'.TABLE_XTENSE_CALLBACKS.'"';
$result = $db->sql_query($query);
if ($db->sql_numrows($result) != 0) {
//Le mod xtense 2 est installé !
//Maintenant on regarde si cdr est dedans normalement oui mais on est jamais trop prudent...
$query = 'SELECT * FROM '.TABLE_XTENSE_CALLBACKS.' WHERE mod_id = '.$mod_id;
$result = $db->sql_query($query);
if ($db->sql_numrows($result) != 0) {
// Il est dedans alors on l'enlève :
$query = 'DELETE FROM '.TABLE_XTENSE_CALLBACKS.' WHERE mod_id = '.$mod_id;
$db->sql_query($query);
}
}
$mod_uninstall_name = "oversight";
$mod_uninstall_table = array(TABLE_OVERSIGHT,TABLE_OVERSIGHT_PLAYERS);
uninstall_mod($mod_uninstall_name, $mod_uninstall_table);