le plugin la ne ve pas marcher
/* Formatright © 2009, ConnorMcLeod
Jail Players Models is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Jail Players Models; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#define VERSION "0.1.0"
#define MAX_PLAYERS 32
#define MAX_MODEL_LENGTH 12
new const g_szTerroristsModels[][] = {
"new_prison",
"new_prison2",
"new_prison3"
}
new const g_szCtModel[] = "ndguards"
new const MODEL[] = "model"
new g_szCmd[] = ";cl_minmodels 0"
new g_szModel[MAX_PLAYERS+1][MAX_MODEL_LENGTH]
new g_iOldTeam[MAX_PLAYERS+1]
public plugin_init()
{
register_plugin("Jail Players Models", VERSION, "ConnorMcLeod")
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
register_forward(FM_SetClientKeyValue, "SetClientKeyValue")
register_message(get_user_msgid("ClCorpse"), "Message_ClCorpse")
}
public plugin_precache()
{
precache_model("models/player/ndguards/ndguards.mdl")
precache_model("models/player/ndguards/ndguardsT.mdl")
precache_model("models/player/new_prison/new_prison.mdl")
precache_model("models/player/new_prison2/new_prison2.mdl")
precache_model("models/player/new_prison3/new_prison3.mdl")
}
public client_connect(id)
{
client_cmd(id, g_szCmd)
}
public client_putinserver( id )
{
g_iOldTeam[id] = 0
if( !is_user_bot(id) )
{
set_task(0.1, "Init_Checks", id)
}
}
public Init_Checks(id)
{
if( is_user_connected(id) )
{
query_client_cvar(id, "cl_minmodels", "Cvar_Result")
}
}
public Cvar_Result(id, const szCvar[], const szValue[])
{
if( is_user_connected(id) )
{
if( szValue[0] != '0' || szValue[1] != 0 )
{
client_cmd(id, g_szCmd)
}
query_client_cvar(id, "cl_minmodels", "Cvar_Result")
}
}
public Player_Spawn_Post(id)
{
if( is_user_alive(id) )
{
new iTeam = _:cs_get_user_team(id)
if( iTeam != g_iOldTeam[id] )
{
g_iOldTeam[id] = iTeam
switch( iTeam )
{
case 1:
{
formatex(g_szModel[id], MAX_MODEL_LENGTH-1, g_szTerroristsModels[ random(sizeof(g_szTerroristsModels)) ])
}
case 2:
{
formatex(g_szModel[id], MAX_MODEL_LENGTH-1, g_szCtModel)
}
}
set_user_info(id, MODEL, g_szModel[id])
}
}
}
public SetClientKeyValue(id, const szInfoBuffer[], const szKey[])
{
if( equal(szKey, MODEL) )
{
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public Message_ClCorpse()
{
set_msg_arg_string(1, g_szModel[ get_msg_arg_int(12) ])
}
|