AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Stupid small problem. (https://forums.alliedmods.net/showthread.php?t=63335)

sQn 11-18-2007 07:21

Stupid small problem.
 
Terrorist and counter-terrorist has helmet. I wont terrorist has beret and ct has helmet [This plug-in bad work on my server]:
PHP Code:

/* AMX Mod X
*   Admin Mark
*
* (c) Copyright 2007 by KaLoSZyFeR
*
* This file is provided as is (no warranties)
*
*     DESCRIPTION
*       Plugin marks admin by adding on his head special helmet or beret. Size of model
* is less than 60kb, so player don't have to extra download whole admin model (size: 2Mb)
* like in other plugins such as KaOs' "Admin Models".
*
*     FEATURES
*       - if admin is CT, he wears special helmet
* - if admin is T, he wears special beret
*
*
*     CVARS
*       amx_admin_mark (0: OFF, 1: ON, default: 1) - disables/enables plugin
*
*     VERSIONS
*       1.0   first release
* 1.1   added forcing standard models, optimized some code
* 1.2   changed really smart part of code (1 word...)
*
*/
#include <amxmodx>
#include <cstrike>
#include <engine>
new g_adminmarkEnt[33]
new 
cvar_enable
new MODEL_MARK[]  = "models/FtF/ADMIN/admin_head.mdl"
static const PLUGIN_NAME[]  = "Admin Mark"
static const PLUGIN_AUTHOR[]  = "KaLoSZyFeR"
static const PLUGIN_VERSION[] = "1.2"
public plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
 
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER
 
cvar_enable register_cvar("amx_admin_mark""1")
}
public 
plugin_precache()
{
 
precache_model(MODEL_MARK
 
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gign/gign.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/gsg9/gsg9.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/sas/sas.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/urban/urban.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/vip/vip.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/sqn/sqn.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/sqn2/sqn2.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/arctic/arctic.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/guerilla/guerilla.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/leet/leet.mdl")
 
force_unmodified(force_model_samebounds,{0,0,0},{0,0,0},"models/player/terror/terror.mdl"
}
public 
client_connect(id)
{
 if(
g_adminmarkEnt[id] > 0)
  
remove_entity(g_adminmarkEnt[id])
 
g_adminmarkEnt[id] = 0
}
public 
client_disconnect(id)
{
 if(
g_adminmarkEnt[id] > 0)
  
remove_entity(g_adminmarkEnt[id])
 
g_adminmarkEnt[id] = 0
}
public 
client_PreThink(id)
{
 if(!
is_user_connected(id))
  return 
PLUGIN_CONTINUE
 
 
if(!is_user_alive(id) && g_adminmarkEnt[id] > 0)
 {
  
remove_entity(g_adminmarkEnt[id])
  
g_adminmarkEnt[id] = 0
 
  
return PLUGIN_CONTINUE
 
}
 
 if (!(
get_user_flags(id) & ADMIN_KICK))
 {
  
remove_entity(g_adminmarkEnt[id])
  
g_adminmarkEnt[id] = 0
 
  
return PLUGIN_CONTINUE
 
}
 
 if(!
get_pcvar_num(cvar_enable))
  return 
PLUGIN_CONTINUE
 
 
if(!is_user_alive(id))
  return 
PLUGIN_CONTINUE
 
 
if(g_adminmarkEnt[id] < 1)
 {
  
g_adminmarkEnt[id] = create_entity("info_target")
  if(
g_adminmarkEnt[id] > 0)
  {
   
entity_set_int(g_adminmarkEnt[id], EV_INT_movetypeMOVETYPE_FOLLOW)
   
entity_set_edict(g_adminmarkEnt[id], EV_ENT_aimentid)
   
entity_set_model(g_adminmarkEnt[id], MODEL_MARK)   
  }
 }
 
 if (
g_adminmarkEnt[id] > 0)
 {
  new 
modelID get_model_id(id)
  
entity_set_int(g_adminmarkEnt[id], EV_INT_bodymodelID)
 }
 if(
g_adminmarkEnt[id] < 1)
  return 
PLUGIN_CONTINUE
 
return PLUGIN_CONTINUE
}
new 
modelname[11][] ={
 
"gign",
 
"gsg9",
 
"sas",
 
"urban",
 
"vip",
 
"sqn",
 
"sqn2",
 
"arctic",
 
"guerilla",
 
"leet",
 
"terror"
}
public 
get_model_id(id)
{
 new 
modelStr[32], iNum=32modelID
 get_user_info
(id,"model",modelStr,iNum)
 
 for(new 
011i++)
 {
  if (
equali (modelStrmodelname[i]) )
  {
   
modelID i
  
}
 } 
 return 
modelID



sQn 11-18-2007 15:27

Re: Stupid small problem.
 
I must define sqn and sqn2 model to ct and te. I don't know this :( sqn - ct, sqn - te


All times are GMT -4. The time now is 01:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.