Raised This Month: $ Target: $400
 0% 

Hard coding steamid into an amxx plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ltcjohnson
Junior Member
Join Date: Nov 2004
Old 03-07-2006 , 09:34   Hard coding steamid into an amxx plugin
Reply With Quote #1

I want to hard code peoples steamid into a plugin because there isnt enough custom admin levels. What would be the best way to go about it?

What would I need to change to have it use steam id instead of the ADMIN_LEVEL_A ect...?

Code:
#include <amxmodx>   #include <amxmisc>   #include <cstrike>   public plugin_init() {     register_plugin("AMX Admin Model", "1.1.1", "whitemike")     register_event("ResetHUD", "resetModel", "b") } public plugin_precache() {     precache_model("models/player/admin_ct/admin_male_ct.mdl")     precache_model("models/player/admin_te/admin_male_te.mdl")     precache_model("models/player/admin_ct/admin_girl_ct.mdl")     precache_model("models/player/admin_te/admin_girl_te.mdl") } public resetModel(id, level, cid) {           if (get_user_flags(id) & ADMIN_LEVEL_A) {                   new CsTeams:userTeam = cs_get_user_team(id)                   if (userTeam == CS_TEAM_T) {                           cs_set_user_model(id, "admin_male_te")         }                   else if(userTeam == CS_TEAM_CT) {                           cs_set_user_model(id, "admin_male_ct")         }                   else {             cs_reset_user_model(id)         }     }           if (get_user_flags(id) & ADMIN_LEVEL_B) {                   new CsTeams:userTeam = cs_get_user_team(id)                   if (userTeam == CS_TEAM_T) {                           cs_set_user_model(id, "admin_girl_te")         }                   else if(userTeam == CS_TEAM_CT) {                           cs_set_user_model(id, "admin_girl_ct")         }                   else {                           cs_reset_user_model(id)         }     }     return PLUGIN_CONTINUE }
ltcjohnson is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-07-2006 , 09:42  
Reply With Quote #2

Well, i posted this already, why wont you try this:
Code:
new steamid[32] get_user_authid(id, steamid, 31)
and:
Code:
new authedSteamId[32] authedSteamId = STEAM_ID_HERE if(steamid == authedSteamId) {     //your code }


off-topic:
Also, why have you people given me -5 karma? ;D

Code:
#include <amxmodx>   #include <amxmisc>   #include <cstrike>   public plugin_init() {     register_plugin("AMX Admin Model", "1.1.1", "whitemike")     register_event("ResetHUD", "resetModel", "b") } public plugin_precache() {     precache_model("models/player/admin_ct/admin_male_ct.mdl")     precache_model("models/player/admin_te/admin_male_te.mdl")     precache_model("models/player/admin_ct/admin_girl_ct.mdl")     precache_model("models/player/admin_te/admin_girl_te.mdl") } public resetModel(id, level, cid) {     new steamid[32]     get_user_authid(id, steamid, 31)     new authedSteamId[32]     authedSteamId[id] = STEAM_ID_HERE     if(steamid == authedSteamId) {         if (get_user_flags(id) & ADMIN_LEVEL_A) {                       new CsTeams:userTeam = cs_get_user_team(id)                       if (userTeam == CS_TEAM_T) {                               cs_set_user_model(id, "admin_male_te")             }                       else if(userTeam == CS_TEAM_CT) {                               cs_set_user_model(id, "admin_male_ct")             }                       else {                 cs_reset_user_model(id)             }         }               if (get_user_flags(id) & ADMIN_LEVEL_B) {                       new CsTeams:userTeam = cs_get_user_team(id)                       if (userTeam == CS_TEAM_T) {                               cs_set_user_model(id, "admin_girl_te")             }                       else if(userTeam == CS_TEAM_CT) {                               cs_set_user_model(id, "admin_girl_ct")             }                       else {                           cs_reset_user_model(id)             }         }     return PLUGIN_CONTINUE }
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-07-2006 , 14:33  
Reply With Quote #3

If your trying to set models to different people by steamids, I would suggest this plugin.

http://forums.alliedmods.net/showthread.php?t=1768

It uses a seperate .ini file which stores steamids and models for steamids. Players do not need to be admin to be in this file.(If you wanted to give the number one player in the server a model and he wasnt admin) And you wouldnt have to change the .sma everytime you get or lose an admin. Hope I helped.
organizedKaoS 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 20:29.


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