 |
|
Junior Member
|

10-21-2006
, 11:45
Re: Can someone fix my Plugin?
|
#4
|
#include <amxmodx>
#include <engine>
#include <cstrike>
new PLUGIN[]="WW2"
new AUTHOR[]="Enblad"
new VERSION[]="1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
//Checks
register_event("ResetHUD", "newSpawn","b")
register_event("CurWeapon", "weaponChange","be","1=1")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/v_shotgunns")
precache_model("models/p_shotgunns")
precache_model("models/player/soldier/Soldier.mdl")
}
//----------------------------------------------------------------------------------------------
public init()
{
giveGun(id)
switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public giveGun(id)
{
if ( is_user_alive(id) ) {
give_item(id, "weapon_m4a1")
}
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_XM1014) {
Entvars_Set_String(id, EV_SZ_viewmodel, "models/v_shotgunns")
Entvars_Set_String(id, EV_SZ_weaponmodel, "models/p_shotgunns")
}
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
new wpnid = read_data(2)
new clip = read_data(3)
if ( wpnid != CSW_XM1014 ) return
switchmodel(id)
if ( clip == 0 ) {
ReloadAmmo(id)
}
}
//----------------------------------------------------------------------------------------------
public changePlayer(id){
cs_set_user_model(id, "models/Soldier.mdl")
}
//----------------------------------------------------------------------------------------------
i changed soldierx how should i do in newspawn and reloadammo?
|
|
|
|