Raised This Month: $51 Target: $400
 12% 

Need to detect is admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaOs
Senior Member
Join Date: Apr 2004
Old 08-08-2004 , 23:06   Need to detect is admin
Reply With Quote #1

Alright guys, heres the deal. I'm making a plugin, so that when an admin joins the server, it changes their model to a special one I designed. All I need help with is:

Detecting if user is admin (when they are connected/put in game)
Getting users' index (so that cs_set_user_model() can be called)

If someone can help me with this I would be willing to give you admin on my server, Traxio.net:27016

Thanks in advance guys..
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 08-09-2004 , 00:08  
Reply With Quote #2

Code:
#include <amxmodx> #include <cstrike> #define MODEL_ACCESS ADMIN_KICK public plugin_init() {   register_plugin("Model Changer","1.0","Qwerty Access")   register_event("ResetHUD", "ReseHud", "b")   return PLUGIN_CONTINUE } public ReseHud(id) {     if (!(get_user_flags(id)&MODEL_ACCESS)) {         return PLUGIN_HANDLED           }             cs_set_user_model(id,"models/admin/admin.mdl")         return PLUGIN_CONTINUE } public plugin_precache()   {      precache_model("models/admin/admin.mdl") }

Might work. just a little loose identation.
__________________
QwertyAccess is offline
Ingram
Veteran Member
Join Date: May 2004
Old 08-09-2004 , 00:28  
Reply With Quote #3

instead of ADMIN_KICK maybe u should use ADMIN_ADMIN, since he said when an admin joins, not when an admin with kick abilities joins, right? Also can u not apply the model on putinserver or would it change when u pick a class?
Ingram is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 08-09-2004 , 01:35  
Reply With Quote #4

well it doesnt hurt just setting the model every time they spawn.
__________________
QwertyAccess is offline
KaOs
Senior Member
Join Date: Apr 2004
Old 08-09-2004 , 13:39  
Reply With Quote #5

Not sure, i'm going to test it out now, thanks guys.

get_user_flags is what I was looking for, thanks again..

I'm gonna slightly modify, test, and repost when I get it working perfectly
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
KaOs
Senior Member
Join Date: Apr 2004
Old 08-09-2004 , 14:26  
Reply With Quote #6

More problems. cs_set_user_model requires INDEX not ID so I am once again clueless as to what I should do..
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
Ingram
Veteran Member
Join Date: May 2004
Old 08-09-2004 , 20:27  
Reply With Quote #7

the id is the index
Ingram is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 08-10-2004 , 00:41  
Reply With Quote #8

Quote:
Originally Posted by KaOs
More problems. cs_set_user_model requires INDEX not ID so I am once again clueless as to what I should do..
the plugin should work fine just test it out.
__________________
QwertyAccess is offline
KaOs
Senior Member
Join Date: Apr 2004
Old 08-10-2004 , 03:08  
Reply With Quote #9

Sorry guys, still doesn't work. I have the cstrike module enabled, engine too. I cs_set_user_model doesn't seem to be doing anything
KaOs is offline
Send a message via AIM to KaOs Send a message via MSN to KaOs
Ingram
Veteran Member
Join Date: May 2004
Old 08-10-2004 , 17:50  
Reply With Quote #10

put console prints in there, make sure it reaches the point where it trys to run that
Ingram is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode