Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <hamsandwich>
- #include <cstrike>
- #include <fakemeta>
- #define PLUGIN "Player Model"
- #define VERSION "1.0"
- #define AUTHOR "GaMeR FoReVeR"
- new const modeli[][] =
- {
- "ctmodel",
- "ttmodel"
- };
- new model_igraca[33][64];
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- RegisterHam(Ham_Spawn, "player", "ham_Spawn", .Post = true);
- register_forward(FM_SetClientKeyValue, "fw_SetKeyValue");
- register_message(get_user_msgid("ClCorpse"), "msg_ClCorpse");
- }
- public plugin_precache()
- {
- precache_model("models/player/ctmodel/ctmodel.mdl");
- precache_model("models/player/ttmodel/ttmodel.mdl");
- }
- public client_putinserver(id)
- {
- model_igraca[id][0] = EOS;
- }
- public ham_Spawn(id)
- {
- if(is_user_alive(id))
- {
- new CsTeams:iTeam = cs_get_user_team(id);
- if(iTeam == CS_TEAM_CT || iTeam == CS_TEAM_T)
- {
- copy(model_igraca[ id ], charsmax(model_igraca[]), modeli[_:iTeam - 1]);
- set_user_info(id, "model", model_igraca[id]);
- }
- }
- }
- public fw_SetKeyValue(id, const _szInfoBuffer[], const _szKey[], const _szValue[])
- {
- if(model_igraca[id][0] && equal(_szKey, "model") && !equal(_szValue, model_igraca[id]))
- {
- set_user_info(id, "model", model_igraca[id]);
- return FMRES_SUPERCEDE;
- }
- return FMRES_IGNORED;
- }
- public msg_ClCorpse()
- {
- new id = get_msg_arg_int(12);
- if(model_igraca[id][0])
- set_msg_arg_string(1, model_igraca[id]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement