AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to change terorists knife model? (https://forums.alliedmods.net/showthread.php?t=132547)

Turkish 07-16-2010 01:40

How to change terorists knife model?
 
How to change terorists knife model?
I want to use it in zombie(not plague or biohazard), jailbreak, deathrun
Can u help me?

drekes 07-16-2010 02:08

Re: How to change terorists knife model?
 
http://forums.alliedmods.net/showthr...odels+extended

Turkish 07-16-2010 03:23

Re: How to change terorists knife model?
 
Thanks but how can i make this plugin only for terorist?
Quote:

#include <amxmodx>
#include <engine>
#include <fakemeta>

new VIEW_MODEL[] = "models/v_newKnife.mdl"
new PLAYER_MODEL[] = "models/p_newKnife.mdl"
new WORLD_MODEL[] = "models/w_knife.mdl"

new OLDWORLD_MODEL[] = "models/w_knife.mdl"

new PLUGIN_NAME[] = "Custom Knife Model"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
new PLUGIN_VERSION[] = "1.0"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
register_forward(FM_SetModel, "fw_SetModel")
}

public plugin_precache()
{
precache_model(VIEW_MODEL)
precache_model(PLAYER_MODEL)
precache_model(WORLD_MODEL)
}

public Event_CurWeapon(id)
{
new weaponID = read_data(2)

if(weaponID != CSW_KNIFE)
return PLUGIN_CONTINUE

set_pev(id, pev_viewmodel2, VIEW_MODEL)
set_pev(id, pev_weaponmodel2, PLAYER_MODEL)

return PLUGIN_CONTINUE
}

public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED

if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED

new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)

if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
engfunc(EngFunc_SetModel, entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}

EpicFail. 07-16-2010 04:03

Re: How to change terorists knife model?
 
How i can make it only for CT and Sepc..

Kreation 07-16-2010 04:21

Re: How to change terorists knife model?
 
PHP Code:

if( cs_get_user_teamid ) == CS_TEAM_CT || cs_get_user_teamid ) == CS_TEAM_SPECTATOR )
{
     
// stuff



Turkish 07-16-2010 04:27

Re: How to change terorists knife model?
 
So like this:
Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>

new VIEW_MODEL[] = "models/v_newKnife.mdl"
new PLAYER_MODEL[] = "models/p_newKnife.mdl"
new WORLD_MODEL[] = "models/w_knife.mdl"

new OLDWORLD_MODEL[] = "models/w_knife.mdl"

new PLUGIN_NAME[] = "Custom Knife Model"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
new PLUGIN_VERSION[] = "1.0"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
register_forward(FM_SetModel, "fw_SetModel")
}

public plugin_precache()
{
precache_model(VIEW_MODEL)
precache_model(PLAYER_MODEL)
precache_model(WORLD_MODEL)
}

public Event_CurWeapon(id)
{
new weaponID = read_data(2)

if(weaponID != CSW_KNIFE || cs_get_user_team( id ) == CS_TEAM_T)
return PLUGIN_CONTINUE

set_pev(id, pev_viewmodel2, VIEW_MODEL)
set_pev(id, pev_weaponmodel2, PLAYER_MODEL)

return PLUGIN_CONTINUE
}

public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED

if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED

new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)

if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
engfunc(EngFunc_SetModel, entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}


Kreation 07-16-2010 04:30

Re: How to change terorists knife model?
 
Test it.

Ryokin 07-16-2010 04:33

Re: How to change terorists knife model?
 
Quote:

Originally Posted by Turkish (Post 1241126)
So like this:
Code:

#include <amxmodx>
#include <engine>
#include <fakemeta>
 
new VIEW_MODEL[] = "models/v_newKnife.mdl"
new PLAYER_MODEL[] = "models/p_newKnife.mdl"
new WORLD_MODEL[] = "models/w_knife.mdl"
 
new OLDWORLD_MODEL[] = "models/w_knife.mdl"
 
new PLUGIN_NAME[] = "Custom Knife Model"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
new PLUGIN_VERSION[] = "1.0"
 
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("CurWeapon", "Event_CurWeapon", "be","1=1")
register_forward(FM_SetModel, "fw_SetModel")
}
 
public plugin_precache()
{
precache_model(VIEW_MODEL)
precache_model(PLAYER_MODEL)
precache_model(WORLD_MODEL)
}
 
public Event_CurWeapon(id)
{
new weaponID = read_data(2)
 
if(weaponID != CSW_KNIFE || cs_get_user_team( id ) == CS_TEAM_T)
return PLUGIN_CONTINUE
 
set_pev(id, pev_viewmodel2, VIEW_MODEL)
set_pev(id, pev_weaponmodel2, PLAYER_MODEL)
 
return PLUGIN_CONTINUE
}
 
public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED
 
if(!equali(model, OLDWORLD_MODEL))
return FMRES_IGNORED
 
new className[33]
entity_get_string(entity, EV_SZ_classname, className, 32)
 
if(equal(className, "weaponbox") || equal(className, "armoury_entity") || equal(className, "grenade"))
{
engfunc(EngFunc_SetModel, entity, WORLD_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}


no wrong , look here :
PHP Code:

if(weaponID != CSW_KNIFE || cs_get_user_teamid ) == CS_TEAM_T)
return 
PLUGIN_CONTINUE 

->
PHP Code:

if(weaponID != CSW_KNIFE) return PLUGIN_CONTINUE
if(get_user_team(id) == 2) return PLUGIN_CONTINUE 


EpicFail. 07-16-2010 04:58

Re: How to change terorists knife model?
 
Quote:

Originally Posted by Ryokin (Post 1241133)
no wrong , look here :
PHP Code:

if(weaponID != CSW_KNIFE || cs_get_user_teamid ) == CS_TEAM_T)
return 
PLUGIN_CONTINUE 

->
PHP Code:

if(weaponID != CSW_KNIFE) return PLUGIN_CONTINUE
if(get_user_team(id) == 2) return PLUGIN_CONTINUE 


Thanks its work :D:D:D

Turkish 07-16-2010 07:47

Re: How to change terorists knife model?
 
oh i forgot to make it "or" to "and" thanks ill test


All times are GMT -4. The time now is 07:09.

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