Jump to content
GIGN Forum

/calladmin


Recommended Posts

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Nez,varbūt šis kods derēs..

#include <amxmodx> #include <dbi> new Sql:dbc new Result:result public plugin_init() {     register_plugin("admincall","0.1","neo-networks")     register_concmd("calladmin", "camenu",-1,"Ruft einen Admin")     register_menucmd(register_menuid("\yCall Admin:"), 1023, "calladmin")     set_task(Float:10.0,"sql_init")     log_amx("[CA Menu] geladen") } public sql_init() {     new host[64], username[32], password[32], dbname[32], error[32]     host="***.***.***.***"     username="******"     password="*******"     dbname="******"     log_amx("[CA Menu] SQL Init")     dbc = dbi_connect(host,username,password,dbname,error,32)     if (dbc == SQL_FAILED)         log_amx("[AMXX] SQL Connection Failed")     else         dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `calladmins` (`Nickname` text NOT NULL,`server` text NOT NULL,`admin` text NOT NULL,`grund` text NOT NULL,  `datum` text NOT NULL) TYPE=MyISAM;") } public calladmin(id,key) {    log_amx("[CA Menu] CallAdmin")     if (dbc == SQL_FAILED)    return PLUGIN_HANDLED     new arg[32]     if (read_argc() == 0) return PLUGIN_HANDLED    switch(key) {       case 0: {          arg="Cheater"       }       case 1: {          arg="Bot"       }       case 2: {          arg="Mapchange"       }       case 3: {          arg="Sonstiges"       }    }     new ServerName[80]          new name[80]     new zeit[21]     get_user_info(id, "name", name, 31)     get_cvar_string("server_name", ServerName, 20)     get_time("%d.%m.%Y - %H:%M:%S",zeit,21)     result = dbi_query(dbc,"INSERT INTO calladmins (nickname,server,grund,datum) VALUES ( '%s','%s','%s','%s' )",name,ServerName,arg,zeit)     if (result == RESULT_OK) dbi_free_result(result)     if (result == RESULT_FAILED) return PLUGIN_HANDLED     new dbitype[32]     dbi_type(dbitype,32)     console_print(id,"Ein Admin wurde verstaendigt")     return PLUGIN_HANDLED } public camenu(id) {    log_amx("[CA Menu] Ca Menu angezeigt")    console_print(id,"CAMenu")    new menu[256]         format(menu, 255, "\yCall Admins:^n^n\w1. Cheater auf dem Server^n2. Probleme mit Bots^n3. Mapchange PLZ^n4. Anderes Problem^n^n\w0. Exit")         show_menu(id, ((1<<0|1<<1|1<<2|1<<3|1<<9)), menu)         return PLUGIN_HANDLED }

Link to comment
Share on other sites

#include <amxmodx> #include <dbi> new Sql:dbc new Result:result public plugin_init() {     register_plugin("admincall","0.1","neo-networks")     register_concmd("calladmin", "camenu",-1,"Ruft einen Admin")     register_menucmd(register_menuid("\yCall Admin:"), 1023, "calladmin")     set_task(Float:10.0,"sql_init")     log_amx("[CA Menu] geladen") } public sql_init() {     new host[64], username[32], password[32], dbname[32], error[32]     host="***.***.***.***"     username="******"     password="*******"     dbname="******"     log_amx("[CA Menu] SQL Init")     dbc = dbi_connect(host,username,password,dbname,error,32)     if (dbc == SQL_FAILED)         log_amx("[AMXX] SQL Connection Failed")     else         dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `calladmins` (`Nickname` text NOT NULL,`server` text NOT NULL,`admin` text NOT NULL,`grund` text NOT NULL,  `datum` text NOT NULL) TYPE=MyISAM;") } public calladmin(id,key) {    log_amx("[CA Menu] CallAdmin")     if (dbc == SQL_FAILED)    return PLUGIN_HANDLED     new arg[32]     if (read_argc() == 0) return PLUGIN_HANDLED    switch(key) {       case 0: {          arg="Cheater"       }       case 1: {          arg="Bot"       }       case 2: {          arg="Mapchange"       }       case 3: {          arg="Sonstiges"       }    }     new ServerName[80]          new name[80]     new zeit[21]     get_user_info(id, "name", name, 31)     get_cvar_string("server_name", ServerName, 20)     get_time("%d.%m.%Y - %H:%M:%S",zeit,21)     result = dbi_query(dbc,"INSERT INTO calladmins (nickname,server,grund,datum) VALUES ( '%s','%s','%s','%s' )",name,ServerName,arg,zeit)     if (result == RESULT_OK) dbi_free_result(result)     if (result == RESULT_FAILED) return PLUGIN_HANDLED     new dbitype[32]     dbi_type(dbitype,32)     console_print(id,"Ein Admin wurde verstaendigt")     return PLUGIN_HANDLED } public camenu(id) {    log_amx("[CA Menu] Ca Menu angezeigt")    console_print(id,"CAMenu")    new menu[256]         format(menu, 255, "\yCall Admins:^n^n\w1. Cheater auf dem Server^n2. Probleme mit Bots^n3. Mapchange PLZ^n4. Anderes Problem^n^n\w0. Exit")         show_menu(id, ((1<<0|1<<1|1<<2|1<<3|1<<9)), menu)         return PLUGIN_HANDLED }

un kas man jaaraksta hosta,usera,paroroles.db nosaukuma vietaa!! un kaa tiesi sis plugins darbojas??

vaitad vins mIrc kanaalaa uzraada??

Link to comment
Share on other sites

Tātad, izskrēju cauri pluginam. Šis plugins uztaisa mysql tabulu, ja tāda jau neekstistē, kur glabā visus requestus pēc admina. Zvaigznīšu vietā ieraksti prasīto, lai pieslēgtos mysql serverim. Tālāk, kad lietotājs pasaka "calladmin", viņam uzlec izvēlne un viņš norāda iemeslu. Serverī čīteris, bots vai vajag mapchange. Tālak reģistrējās laiks, izsauktā spēlētāja niks un citi sūdi. Mircā scripts nav paredzēts, ja vien Tu nevari atrast irc botu, kurš spēj piekļūt mysql datubāzei. Vienvārdsakot, adminiem reāli vajadzēs visu laiku vērot webu, vai nav kāds jauns requests. Ja labi uztaisīsi, tas pat varētu diez gan forši adminiem to paziņot. Izmest kādu logu uz ekrāna. Pieņemsim, ar javascriptu vari uztaisīt, lai alertus met ārā vai tml. Domā pats. Nav slikts plugins, īstenībā.

Edited by n0r3k
Link to comment
Share on other sites

labi skaidriite !! meeginaasu kautko uzmutiit!!!

EDIT: meeginaaju kautkas nesanaaca!

kompliteejot paraadiija

//// calladmin.sma
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(0) : error 075
: input line too long (after substitutions)
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(1) : error 038
: extra characters on line
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(1) : error 075
: input line too long (after substitutions)
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(4) : error 010
: invalid function or declaration
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(5) : warning 2
03: symbol is never used: "ins"
// C:\mansserveris\cstrike\addons\amxmodx\scripting\calladmin.sma(5) : error 013
: no entry point (no public functions)
//
// 5 Errors.
// Could not locate output file compiled\calladmin.amx (compile failed).
//
// Compilation Time: 0,44 sec

Edited by lazda2
Link to comment
Share on other sites

bet nu ja vajag, tad ņem. trūka pāris semikoli, kā arī sakārtotības nekās. sakārtoju un kļūdas izlaboju. nokompilēt arī izdevās. nomaini ip, user, pass un dbname.

Edited by n0r3k
Link to comment
Share on other sites

a kaa jausauc admini??EDIT: sito atradu bet kaa lai apskaataas ka kaads izsaucis???

visaadi izmeeginaaju neko neraada!! un kur varees redzeet ka kaads saucis??

Edited by lazda2
Link to comment
Share on other sites

ja Tu runā par pirmo scriptu, tad mysql datubāze, ja Tev tāda ir.

tas, lai Tu to redzētu, diemžēl Tev pašam jāuztaisa. kas gan tur grūts, ieselektēt laukus un padot html`am.

Edited by n0r3k
Link to comment
Share on other sites

Cits piemers ka no mysql iznem admin nikus un banu skaitlu, kaut ko lidzigu megini sastukot ar so te :)

<?php

echo "<table id='admintop'>
<tr>
<th>Admins</th>
<th>Bani</th>
</tr>";

$con = mysql_connect("localhost","kvaziiks","robiks");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("bans", $con);

$result = mysql_query("SELECT count(*), admin_nick FROM amx_bans GROUP BY admin_nick ORDER BY count(*) DESC LIMIT 19"); // DESC LIMIT 5 noziimee, ka vinjsh paraadiis 5 aktiivaakos

while($row = mysql_fetch_array($result))
{
$admins = $row['admin_nick'];
$skaits = $row['count(*)'];
echo "<tr>
<td>$admins</td>
<td>$skaits</td>
</tr>";
}
mysql_close($con);
?>
</table>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share


×
×
  • Create New...