VIP 人物皮肤可选择替换【开源】【半仙】
本帖最后由 刘半仙【仙】 于 2013-5-14 21:05 编辑鉴于点通创始人决定不关闭点通,特此分享一下,作品很渣,望谅解.
1.插件命令: say skin
2.模型替换 菜单显示权限:ADMIN_LEVEL_F
3.原创,略搓。(勿喷,转载望勿修改版权)
4 . 源码放2楼
mdl文件过大
仅上传amxx
模型加载:public plugin_precache() {
//第一组 - 草薙京兄弟
precache_model("models/player/1_T/1_T.mdl")
precache_model("models/player/1_TC/1_TC.mdl")
//黑白精灵MM
precache_model("models/player/2_T/2_T.mdl")
precache_model("models/player/2_TC/2_TC.mdl")
//中国特警队
precache_model("models/player/4_T/4_T.mdl")
precache_model("models/player/4_TC/4_TC.mdl")
return PLUGIN_CONTINUE
}
希望大家踊跃发帖,提意见,分享东西! 本帖最后由 刘半仙【仙】 于 2013-5-14 20:42 编辑
特提供源码:
望批评指正
渣作勿喷
版权保留/*---------------------
半仙出品
1.模型替换为开局替换,玩家选择后不是立即替换
2.替换模型为一组,即一组模型对于CT 和T 2个模型
3.判别模型方法, 存取选择对于的T模型文件名字 判断玩家为CT将T模型文件+"C" 转换
----------------------*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN_NAME "modchoose"
#define PLUGIN_VERSION "2.2.1"
#define PLUGIN_AUTHOR "kyo"
new playermod,alreadyChoose,bool:Is_choosed,bool:Round_choosed
//模型准备名字
new menuitem[] = {"草薙京兄弟","黑白精灵MM","中国特警队","换原始模型"} //3套替换模型修改前3项名字即可
new prepmod[] = {"1_T","2_T","4_T"} // 模型mdl文件名字 ,T模型的名字 CT模型名字为T模型名字+“C”
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
server_print("^n^t==========================================================^n^t %s %s, Copyright (C) 2012 by %s^n^t==========================================================^n",PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_AUTHOR);
register_clcmd("say skin","selecmenu")
register_event("ResetHUD", "resetModel", "b")
}
/*---------------------
模型加载
备注:CT的模型为 T模型名字加一个C
----------------------*/
public plugin_precache() {
//第一组 - 草薙京兄弟
precache_model("models/player/1_T/1_T.mdl")
precache_model("models/player/1_TC/1_TC.mdl")
//黑白精灵MM
precache_model("models/player/2_T/2_T.mdl")
precache_model("models/player/2_TC/2_TC.mdl")
//中国特警队
precache_model("models/player/4_T/4_T.mdl")
precache_model("models/player/4_TC/4_TC.mdl")
return PLUGIN_CONTINUE
}
/*---------------------
菜单区
----------------------*/
public selecmenu(id)
{
new Message
if(get_user_flags(id) & ADMIN_LEVEL_F)
{
new menu = menu_create("\r模型菜单", "Select");
/* 菜单选项*/
for(new a = 0;a<4;a++)
{ new tmp,num
num_to_str(a+1, num, 4);
if(a == alreadyChoose){
format(tmp,125,"\d%s(\r已选择\d)",menuitem)
}
else{
format(tmp,125,"\w%s",menuitem)
}
menu_additem(menu, tmp, num, 0);
}
/*end*/
menu_setprop(menu, MPROP_EXITNAME, "\y退出菜单");
if(Round_choosed == true)
{
format(Message, 125, "^x04|灬FourKing灬|提示:^x01____一局只能选择一次");
client_color(id, id,Message)
}
else{
menu_display(id, menu, 0);
}
}
else
{
format(Message, 125, "^x04|灬FourKing灬|提示:^x01你没有这个权限,群号:37061111");
client_color(id, id,Message)
}
return PLUGIN_HANDLED;
}
public Select(id, menu, item)
{
new szMessage,name
get_user_name(id,name,31)
new data, iName;
new access, callback;
menu_item_getinfo(menu, item, access, data,9, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 4:
{
if(Is_choosed){
Is_choosed = false
alreadyChoose= -1
format(szMessage, 255, "^x04|灬FourKing灬|:^x01^x03%s^x01^x04更换为^x03原始模型",name);
client_color(0, id,szMessage)
}
else
{
format(szMessage, 255, "^x04|灬FourKing灬|:^x01没有选择皮肤,^x03%s^x01^x04不用更换",name);
client_color(id, id,szMessage)
}
}
default:
{ new chooseitem = key - 1 //转换为数组索引
if(alreadyChoose == chooseitem){
menu_display(id, menu, 0);
}
else{
if(chooseitem <3 && chooseitem >=0){
alreadyChoose = chooseitem
// 准备模型
new modname
format(modname,15,"%s",prepmod)
playermod = modname
Is_choosed = true
Round_choosed = true
format(szMessage, 255, "^x04|灬FourKing灬|:^x01^x03%s^x01^x04更换模型为^x03|%s|",name,menuitem);
client_color(0, id,szMessage)
}
else{
log_amx("准备数组超出索引范围")
}
}
}
}
}
/*---------------------
模型置换(开局)
----------------------*/
public resetModel(id, level, cid) {
if (get_user_flags(id) & ADMIN_LEVEL_F)
{
new CsTeams:userTeam = cs_get_user_team(id)
if (Is_choosed == true && userTeam == CS_TEAM_T)
{
cs_set_user_model(id, playermod)
}
elseif (Is_choosed == true && userTeam == CS_TEAM_CT)
{
new tmp
format(tmp,31,"%sC", playermod) // 转换为CT需要的模型字符 +“c”
cs_set_user_model(id, tmp)
}
else
{
cs_reset_user_model(id)
}
}
else
{
cs_reset_user_model(id)
}
if(Round_choosed)
{
Round_choosed = false;
}
return PLUGIN_CONTINUE
}
/*---------------------
其他
----------------------*/
public client_authorized(id)
{
Is_choosed = false;
Round_choosed = false;
alreadyChoose = -1
}
public client_disconnect(id)
{
if(Is_choosed)
Is_choosed = false;
if(Round_choosed)
Round_choosed = false;
if(alreadyChoose != -1)
alreadyChoose = -1;
}
public client_color(playerid, colorid, msg[]){
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),{0,0,0},playerid)
write_byte(colorid)
write_string(msg)
message_end()
} 楼主 我又来顶你了:P 友情帮顶......:).看起来不错 我也支持一下! 顶,支持个!!!! 现在都没人评精华帖子了 除了使劲发帖子就要像我一样买金币喽:L 现在不就是注册会员了吗:kiss::kiss::kiss:恭喜啊 顶,不错呀、; 1.5的玩家飘过,很不错,可惜模型和插件都不支持1.5
页:
[1]
2