Raised This Month: $ Target: $400
 0% 

use an ini file to...


Post New Thread Reply   
 
Thread Tools Display Modes
scriptyboy
BANNED
Join Date: Sep 2005
Old 09-28-2005 , 16:50  
Reply With Quote #11

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define MAX_STUFF  64 /* / How it works g_szInfo[i][0] = AuthID g_szInfo[i][1] = Model / */ new g_szInfo[MAX_STUFF][2][65] new g_iCount = 0 public plugin_init() {     ReadFile() //... } public ReadFile() {     new szFile[66]     get_configsdir( szFile , 65 )     format(szFile , 65 , "%s/models.ini",szFile)     if(!file_exists(szFile))     {         log_amx("[ChickenSuit] File ^"%s^" doestn exist. Please insure its there.")         return PLUGIN_HANDLED     }     new szLine[101] , line = 0, len = 0     while(read_file(szFile, line++ , szLine , 100 , len) && (g_iCount < MAX_STUFF) )     {         if(szLine[0] == ';' || !len) continue         strbreak(szLine, g_szInfo[g_iCount][0] , 63 , g_szInfo[g_iCount][1] , 63)         g_iCount++     }     return } //Your code revised public plugin_precache() {       for(new i = 0; i < g_iCount; i++)     {        precache_model(g_szInfo[i][1])   //I think this should work.          //If it doesnt work try adding "g_szInfo[i][1] =  " before precache_model     } }     public resetModel(id, level, cid) {           new authid[50]             get_user_authid(id,authid,49)             for(new i = 0; i <g_iCount; i++)         {              if(equali(authid,g_szInfo[i][0])) {                         new CsTeams:userTeam = cs_get_user_team(id)                       if (userTeam == CS_TEAM_T) {                               cs_set_user_model(id, g_szInfo[i][1])                      }                      else if(userTeam == CS_TEAM_CT) {                              cs_set_user_model(id, g_szInfo[i][1])                      }                      else {                               cs_reset_user_model(id)                      }                 }         }           return PLUGIN_CONTINUE   }
scriptyboy is offline
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-28-2005 , 16:51  
Reply With Quote #12

ok it will be fixed in a few minuts
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
scriptyboy
BANNED
Join Date: Sep 2005
Old 09-28-2005 , 16:52  
Reply With Quote #13

kk thx...y dont u change ur sig?
scriptyboy is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-28-2005 , 16:55  
Reply With Quote #14

1) That wasnt all the code needed. you have to combine what you had in plugin_init
2) find
Code:
       g_iCount++     }     return }
change to
Code:
       g_iCount++     }     return PLUGIN_CONTINUE }

and btw these are just warnings doesnt affect plugin output.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-28-2005 , 16:56  
Reply With Quote #15

FIXED
Code:
#include <amxmodx>   #include <amxmisc>   #include <cstrike> #define MAX_STUFF  64   /* / How it works   g_szInfo[i][0] = AuthID   g_szInfo[i][1] = Model   / */   new g_szInfo[MAX_STUFF][2][65]   new g_iCount = 0   public plugin_init()       {       ReadFile()   }   public ReadFile()       {       new szFile[66]       get_configsdir( szFile , 65 )       format(szFile , 65 , "%s/models.ini",szFile)           if(!file_exists(szFile))           {           log_amx("[ChickenSuit] File ^"%s^" doestn exist. Please insure its there.")           return PLUGIN_HANDLED       }           new szLine[101] , line = 0, len = 0       while(read_file(szFile, line++ , szLine , 100 , len) && (g_iCount < MAX_STUFF) )           {           if(szLine[0] == ';' || !len) continue                   strbreak(szLine, g_szInfo[g_iCount][0] , 63 , g_szInfo[g_iCount][1] , 63)           g_iCount++       }       return PLUGIN_CONTINUE }   //Your code revised   public plugin_precache() {         for(new i = 0; i < g_iCount; i++)           {           precache_model(g_szInfo[i][1])   //I think this should work.           //If it doesnt work try adding "g_szInfo[i][1] =  " before precache_model       }   }     public resetModel(id, level, cid) {         new authid[50]         get_user_authid(id,authid,49)         for(new i = 0; i <g_iCount; i++)           {           if(equali(authid,g_szInfo[i][0])) {                 new CsTeams:userTeam = cs_get_user_team(id)                 if (userTeam == CS_TEAM_T) {                     cs_set_user_model(id, g_szInfo[i][1])                 }                 else if(userTeam == CS_TEAM_CT) {                     cs_set_user_model(id, g_szInfo[i][1])                 }                 else {                     cs_reset_user_model(id)                 }             }       }             return PLUGIN_CONTINUE     }
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-28-2005 , 16:56  
Reply With Quote #16

it shouldnt have any warnings or any errors
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
scriptyboy
BANNED
Join Date: Sep 2005
Old 09-28-2005 , 17:00  
Reply With Quote #17

kk thx

will this work in the ini file?

Code:
//Add as many steam ids to agree with model...using:
//"STEAM ID" "Model Location\model.mdl

//Example (remove the slashes to make this work.)
//"STEAM_0:0:1967352" "C:\Program Files\Valve\Steam\SteamApps\cstrikededicated01\dedicated server\cstrike\addons\amxmodx\models\player\chickenmodel\chickenmodel.mdl"
scriptyboy is offline
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-28-2005 , 17:01  
Reply With Quote #18

it should ... you shouldnt put dedicated server tho newbies who have real servers will be like
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
scriptyboy
BANNED
Join Date: Sep 2005
Old 09-28-2005 , 17:05  
Reply With Quote #19

and can someone edit this skin for me?? i want it to look like a giant chicken...like with yellow feathers and everything...Then attach it for me and ill add it to the model.
Attached Files
File Type: zip chicken.zip (167.7 KB, 104 views)
scriptyboy is offline
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-28-2005 , 17:07  
Reply With Quote #20

now i cant help you there. i cant edit/make models ... i would if somebody tole me how
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
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 17:05.


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