Raised This Month: $ Target: $400
 0% 

Help with my plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 05-01-2006 , 08:12  
#8

Not tested, but it compiles okay

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("Clan Models","0.1","Dizzy")     register_event("ResetHUD", "modelreset", "b")     return PLUGIN_HANDLED } public plugin_precache() {     precache_model("models/clanter/clanter.mdl")     precache_model("models/clanct/clanct.mdl")     return PLUGIN_CONTINUE } public modelreset(id) {     //Get filepath     new filepath[64]     get_configsdir(filepath, 63)     format(filepath, 63, "%s/clanmodels.cfg", filepath)     if(file_exists(filepath))     {         new output[128]         new fHandle = fopen(filepath, "rt")         if(!fHandle)             return PLUGIN_CONTINUE         for(new a = 0; !feof(fHandle); a++)         {             //Get line             fgets(fHandle, output, 511)                 //Check if line is invalid             if(output[0] == ';' || !output[0] || output[0] == ' ' || output[0] == 10)                 continue;                             //Get authid             new authid[35]             get_user_authid(id, authid, 34)                         //Containi is used since I'm not in the mood of stripping newlines             if(containi(output, authid) != -1)             {                 new CsTeams:userTeam = cs_get_user_team(id)                         if (userTeam == CS_TEAM_T)                 {                     cs_set_user_model(id, "clanter")                 }                     if(userTeam == CS_TEAM_CT)                 {                     cs_set_user_model(id, "clanct")                 }               }         }     }         return PLUGIN_CONTINUE; }

One small note: Make sure the folder where de models are in is named the same as the model itself.

EG: models/clanter/clanter.mdl and NOT models/clanmodels/clanter.mdl
Same with the CT models offcourse

Good luck
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
 



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 05:08.


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