.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Bug Reports (http://forums.bots-united.com/forumdisplay.php?f=49)
-   -   PB - R2B46d + adminmodel.amx Plugin (http://forums.bots-united.com/showthread.php?t=5049)

Abrachius 20-03-2006 02:15

PB - R2B46d + adminmodel.amx Plugin
 
Hello,
since quite a while I've been running a CS 1.6 dedicated Server with AMX 0.9.9b, metamod 1.17.1 on a linux machine. I have several plugins for amx installed and everything is really running fine.
Just a few weeks ago i stumbled over an awesome plugin, its the adminmodel plugin which allows admin on a server to have another model/skin.

I had a a covertops plugin once installed and it worked pretty well with the bots, the plugin allows you to put on the skin of a killed enemy, the podbots work pretty good with it, since they seem to look at the model or the skin, your teammates dont notice you as a friend and shoot at you and the enemys dont notice you as an enemy... at a new round the model is switched back to normal.
having all this in mind we come to the problem of the adminmodel plugin:

as an admin, or by steamid you join the server, the plugin notices you the first time and assignes an admin model to your id. i joined terrorists the first time and got the admin-terrorist model. after a round i wanted to test the ct admin model and changed team, but as soon as buytime was over my bot-teammates started attacking me.
even after reconnecting to the server i only might join the terrorist team because my ct team mates still attack me. it seems like the model is correct but the bots dont notice me as a ct-teammate, in this case.

The original plugincode is this, where i just changed set_user_model to CS_SetModel.

Code:

#include <amxmod>
#include <amxmisc>
#include <VexdUM>

public plugin_init() {
        register_plugin("AMX Admin Model", "1.1.1", "whitemike")
        register_event("ResetHUD", "resetModel", "b")
        return PLUGIN_CONTINUE
}

public plugin_precache() {
        precache_model("models/player/admin_ct/admin_ct.mdl")
        precache_model("models/player/admin_te/admin_te.mdl")

        return PLUGIN_CONTINUE
}

public resetModel(id, level, cid) {
        if (get_user_flags(id) & ADMIN_KICK) {
                new userTeam = get_user_team(id)
                if (userTeam == 1) {
                        CS_SetModel(id, "admin_te")
                }
                else if(userTeam == 2) {
                        CS_SetModel(id, "admin_ct")
                }
                else {
                        CS_SetModel(id)
                }
        }

        return PLUGIN_CONTINUE
}

It crashes my server as soon as i connect.

I tried the next one which worked as above written, it didnt crash the server but the bots teamattacked me.

Code:

#include <amxmod>
#include <Vexd_Utilities>


public plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike")
register_event("ResetHUD", "resetHud", "b")
}

public
plugin_precache() {
precache_model("models/player/admin_ct/admin_ct.mdl")
precache_model("models/player/admin_te/admin_te.mdl")
}

public
resetHud(id) {
set_task(0.2, "resetModel", id)
}

public
resetModel(id) {
new
authid[32]
get_user_authid(id, authid, 31)
new
userTeam = get_user_team(id)
if(
equal(authid, "STEAM_")) {
  if (
userTeam == 1)
   
CS_SetModel(id, "admin_te")
  else if(
userTeam == 2)
   
CS_SetModel(id, "admin_ct")
}
else if(
equal(authid, "STEAM_")) {
  if (
userTeam == 1)
   
CS_SetModel(id, "admin_te")
  else if(
userTeam == 2)
   
CS_SetModel(id, "admin_ct")
}
else if(
equal(authid, "STEAM_")) {
  if (
userTeam == 1)
   
CS_SetModel(id, "admin_te")
  else if(
userTeam == 2)
   
CS_SetModel(id, "admin_ct")
}
}



it also didnt work with this aswell:

Code:


Code:

#include <amxmod>
#include <Vexd_Utilities>

stock is_user_admin(id){
return (
get_user_flags(id)>0 && !(get_user_flags(id)&ADMIN_USER) )
}

public
plugin_init() {
register_plugin("AMX Admin Model", "1.1.1", "whitemike")
register_event("ResetHUD", "resetHud", "b")
}

public
plugin_precache() {
precache_model("models/player/admin/admin_ct.mdl")
precache_model("models/player/admin/admin_te.mdl")
}

public
resetHud(id) {
set_task(0.2, "resetModel", id)
}

public
resetModel(id) {
if (
is_user_admin(id)) {
new
userTeam = get_user_team(id)
if (
userTeam == 1) {
CS_SetModel(id, "admin_ct")
}
else if(
userTeam == 2) {
CS_SetModel(id, "admin_te")
}
else {
CS_ClearModel(id)
}
}
return
PLUGIN_CONTINUE
}



I read through 16 pages on the amxx forums where the plugin seems to have its origin, and one post said that it cant work with podbots... but i dont know how reliable that is, cause the covertops plugin worked great....

thx for the help

KWo 20-03-2006 09:08

Re: PB - R2B46d + adminmodel.amx Plugin
 
The problem You have was described few times at podbot mm forum. It's related to the team detection code. It's based on skin/model - so if You change the skin of some player - the bot starts to think it's an enemy. It's the problem with SuperHero, ChickenMod WC3FT ect. Currently - in sources we implemented the team detection based on TeamInfo messages (the same way AMX recognizes teams) - so it will not be the problem with it anymore.
The beta of this bot will be released during 1-2 wekks - I think. I would post it even right now, but splorygon is still working on something and he didn't merge yet my changes. Probably I'll need to merge his changes (it will be more easy - less changes than these I did) - then we post a beta. Stay tuned.

Abrachius 20-03-2006 09:45

Re: PB - R2B46d + adminmodel.amx Plugin
 
Awesome... i can wait :) thats great...

the thing that bothers me though is now, the bots in the Terrorist Team, where I have a custom plugin also, dont shoot me... so there must be something "on" me that makes me their friend and still marks me as an enemy to the ct...

I still believe this plugin could work with the bots, if the plugin would change :)
but maybe i know too little about botcode :)

thx for your quick help...


All times are GMT +2. The time now is 04:48.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.