Okay. I got this plugin that changes models. How ever if I change the model it doesnt ownload the new one. what would i have to put in the plugin to make it verify the file and if it isnt the same to download the new one?
Code:
public new_round(id)
{
if( get_cvar_num("cia_AdminModels") ){
new sSteamIDTemp[18]
get_user_authid(id,sSteamIDTemp,18)
for (new i=0; i<=200; i++){
//if if id matches steamid at index i in the array.
if ( equal(sSteamIDTemp,sSteamID[i]) ) {
//if T
if ( cs_get_user_team(id) == 1 ) {
cs_set_user_model(id, sTModel[i])
}
//if CT and not vip
if ( (cs_get_user_team(id) == 2) && (cs_get_user_vip(id) != 1) ){
cs_set_user_model(id, sCTModel[i])
}
}
}
}
//this forces users to precache the models so they HAVE to see the models people have.
//later versions will include an element in the ini file which will let you choose if it does or not.
public plugin_precache()
{
if(file_exists("addons/amxmodx/configs/cia_adminmodels.cfg") == 1) {
new line, stxtsize
new data[18]
new iCurrentPos = 0
while( ((line=read_file("addons/amxmodx/configs/cia_adminmodels.cfg",line,data,17,stxtsize))!=0) && (iCurrentPos != 200) )
{
new sModelLoc[80]
if ( (data[0] == ';') ) continue
sSteamID[iCurrentPos] = data
if ( (line=read_file("addons/amxmodx/configs/cia_adminmodels.cfg",line,data,17,stxtsize))!=0 ){
add(sModelLoc,80,"models/player/",0)
add(sModelLoc,80,data,0)
add(sModelLoc,80,"/",0)
add(sModelLoc,80,data,0)
add(sModelLoc,80,".mdl",0)
precache_model( sModelLoc )
sTModel[iCurrentPos] = data
}
if ( (line=read_file("addons/amxmodx/configs/cia_adminmodels.cfg",line,data,17,stxtsize))!=0 ){
sModelLoc = ""
add(sModelLoc,80,"models/player/",0)
add(sModelLoc,80,data,0)
add(sModelLoc,80,"/",0)
add(sModelLoc,80,data,0)
add(sModelLoc,80,".mdl",0)
precache_model( sModelLoc )
sCTModel[iCurrentPos] = data
}
iCurrentPos = iCurrentPos + 1
}
}