Raised This Month: $51 Target: $400
 12% 

Set Model by cmd_box


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nightzombie
BANNED
Join Date: Sep 2011
Old 09-15-2011 , 06:38   Set Model by cmd_box
Reply With Quote #1

Hello, i want set a model of boxing gloves in this script (I have the models) i want only the commande who let me to set: v_boxing.mdl & p_boxing.mdl


Quote:
public cmd_box(id)
{
static i
if((id < 0) || (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT))
{
if(g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > 1)
{
for(i = 1; i <= g_MaxClients; i++)
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
set_user_health(i, 100)

set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
g_BoxStarted = 1
player_hudmessage(0, 1, 3.0, _, "%L", LANG_SERVER, "JBE_GUARD_BOX")
}
else
{
player_hudmessage(id, 1, 3.0, _, "%L", LANG_SERVER, "JBE_GUARD_CANTBOX")
}
}
return PLUGIN_HANDLED
}
I try this:

format(vModel,55,"models/jbextreme/v_box.mdl")
format(pModel,55,"models/jbextreme/p_box.mdl")

But doesn't works
nightzombie is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-15-2011 , 08:31   Re: Set Model by cmd_box
Reply With Quote #2

format() has nothing to do with setting models, it just formats a string.

Code:
entity_set_string(id, EV_SZ_viewmodel, "v_model...")
entity_set_string(id, EV_SZ_weaponmodel, "p_model...")
__________________
Hunter-Digital is offline
nightzombie
BANNED
Join Date: Sep 2011
Old 09-15-2011 , 11:33   Re: Set Model by cmd_box
Reply With Quote #3

it's not working, i'm using what you say::
Quote:
public cmd_box(id)
{
static i
if((id < 0) || (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT))
{
if(g_TeamAlive[CS_TEAM_T] <= get_pcvar_num(gp_BoxMax) && g_TeamAlive[CS_TEAM_T] > 1)
{
for(i = 1; i <= g_MaxClients; i++)
if(is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
set_user_health(i, 100)

entity_set_string(id, EV_SZ_viewmodel, "v_boxing.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "p_boxing.mdl")
set_cvar_num("mp_tkpunish", 0)
set_cvar_num("mp_friendlyfire", 1)
g_BoxStarted = 1
player_hudmessage(0, 1, 3.0, _, "%L", LANG_SERVER, "JBE_GUARD_BOX")
}
else
{
player_hudmessage(id, 1, 3.0, _, "%L", LANG_SERVER, "JBE_GUARD_CANTBOX")
}
}
return PLUGIN_HANDLED
}

Last edited by nightzombie; 09-15-2011 at 11:36.
nightzombie is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-15-2011 , 12:41   Re: Set Model by cmd_box
Reply With Quote #4

UPload the whole thing and use [pawn] tags
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-15-2011 , 15:01   Re: Set Model by cmd_box
Reply With Quote #5

You don't seem to understand what it's going on in that code... replace "id" with "i" because you placed it in a loop of players and "i" is each player, id is the player that triggers the cmd.

Also, if player swaps weapons it will reset the model.
__________________
Hunter-Digital is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 09-15-2011 , 17:31   Re: Set Model by cmd_box
Reply With Quote #6

BTW, he is both non-steam and avoiding bans. He has another account that is banned.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:20.


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