Rulzy,关于你发布的解决群踢皮肤插件的问题!!
你发布的插件,我运行在服务器,很稳定。可是也带来一个问题,皮肤文件有6个,第一次或者网吧的玩家每次进来都要下载,需要不少时间,所以我想去掉几个皮肤,保留2个,或者4个,但是我修改后,编译提示有错误,所以麻烦你能不能帮忙修改一下,改成4个皮肤和2个皮肤的版本,这样对一些希望少下载或者下载时间不长的玩家来说,他们也能接受。麻烦你了。方便的话可以加下你的QQ么? 你要换个文本编辑软件,用EmEditer,保存的时候别用签名。基本上修改插件后无法编译都是这个问题。 楼上的,怎么联系?方便加QQ么? Rulzy,冒泡啊 //4个皮肤
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
// 请修改成相应的权限
#define ADMIN_OP_LEVEL ADMIN_LEVEL_F // "q"
#define ADMIN_VIP_LEVEL ADMIN_LEVEL_G // "r"
// 请修改成你所需要的模型
new g_Model[]={
"CVTOP_T", // OP(T)
"CVTOP_CT", // OP(CT)
"CVTVIP_T", // VIP(T)
"CVTVIP_CT" // VIP(CT)
}
public plugin_init(){
register_plugin("Admin Model","2.3","Rulzy")
RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
}
public plugin_precache(){
new modelname
for(new i=0;i<6;i++){
formatex(modelname, 63, "models/player/%s/%s.mdl", g_Model, g_Model)
precache_model(modelname)
}
}
public fw_PlayerSpawn(id)
{
if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_CONTINUE;
new CsTeams:userTeam = cs_get_user_team(id);
new ModelIndex = -1;
new flags = get_user_flags(id);
if (flags & ADMIN_OP_LEVEL){
if (userTeam == CS_TEAM_T){
ModelIndex = 0
}
else if(userTeam == CS_TEAM_CT) {
ModelIndex = 1
}
}else if (flags & ADMIN_VIP_LEVEL){
if (userTeam == CS_TEAM_T){
ModelIndex = 2
}
else if(userTeam == CS_TEAM_CT){
ModelIndex = 3
}
}
if(ModelIndex==-1)
{
cs_reset_user_model(id);
}else{
cs_set_user_model(id, g_Model);
}
return PLUGIN_CONTINUE
}
//两个皮肤
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
// 请修改成相应的权限
#define ADMIN_OP_LEVEL ADMIN_LEVEL_F // "q"
// 请修改成你所需要的模型
new g_Model[]={
"CVTOP_T", // OP(T)
"CVTOP_CT" // OP(CT)
}
public plugin_init(){
register_plugin("Admin Model","2.3","Rulzy")
RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
}
public plugin_precache(){
new modelname
for(new i=0;i<6;i++){
formatex(modelname, 63, "models/player/%s/%s.mdl", g_Model, g_Model)
precache_model(modelname)
}
}
public fw_PlayerSpawn(id)
{
if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_CONTINUE;
new CsTeams:userTeam = cs_get_user_team(id);
new ModelIndex = -1;
new flags = get_user_flags(id);
if (flags & ADMIN_OP_LEVEL){
if (userTeam == CS_TEAM_T){
ModelIndex = 0
}
else if(userTeam == CS_TEAM_CT) {
ModelIndex = 1
}
}
if(ModelIndex==-1)
{
cs_reset_user_model(id);
}else{
cs_set_user_model(id, g_Model);
}
return PLUGIN_CONTINUE
}
楼上的,多谢了。我修改的时候画蛇添足了,把i<6改成i<4了。 如果超过4个呢? 顶一下,找了半天 本帖最后由 kk阿朗 于 2010-8-4 11:40 编辑
那个循环里的面是要改的,
如果是2个皮肤for (new i = 0; i < 2; i++)如果是4个皮肤for (new i = 0; i < 4; i++)如果超过以上的,可以这样写new g_Model[][]={
"blabla",
"blabla",
"blabla",
"blabla",
"blabla",
"blabla",
"blabla",
"blabla",
"blabla",
}
//......
for (new i = 0; i < sizeof g_Model; i++)
页:
[1]