Raised This Month: $ Target: $400
 0% 

Model problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 02:23   Model problem
Reply With Quote #1

How i can change model of the player? I wanna change T model to CT but then i write this code and select from menu skin he's don't wear up
PHP Code:
precache_model("models\player\model\model.mdl"
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-12-2010 , 03:06   Re: Model problem
Reply With Quote #2

Use this:
PHP Code:
 /* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>

#define PLUGIN "Jail Break model"
#define VERSION "1.2"
#define AUTHOR "naven"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""runda"1);
}
public 
runda(id){
    if(
cs_get_user_team(id) == CS_TEAM_T) {    
    if(
is_user_connected(id))
    
cs_set_user_model(id"wiezien")
    }
    else if(
cs_get_user_team(id) == CS_TEAM_CT){
    
cs_set_user_model(id"klawisz")
}
}
public 
plugin_precache(){
    
precache_model("models/player/wiezien/wiezien.mdl")
    
precache_model("models/player/klawisz/klawisz.mdl")

__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 03:12   Re: Model problem
Reply With Quote #3

Thx but i need into in "Fun Buy" Here's my code:
Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>

#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_clcmd( "say /funbuy", "FunBuy" );
    register_clcmd( "say_team /funbuy", "FunBuy" );

}
public FunBuy(id)
{
    new menu = menu_create("\gFun Buy Menu:", "menu_handler");

    menu_additem(menu, "\w Low Gravity - \r4000", "1", 0);
    menu_additem(menu, "\w Buy C4 - \r16000", "2", 0);
    menu_additem(menu, "\w CT skin - \r14500", "3", 0);

    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, menu, 0);
}

public menu_handler(id, menu, item)
{
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }
    
    new data[6], iName[64];
    new acess, callback;

    menu_item_getinfo(menu, item, acess, data,6, iName, 63, callback);
    new key = str_to_num(data);
    
    switch(key)
    {
        case 1 : //gravity
        {
            new name[32];
            
            if (cs_get_user_money(id) < 4000)
            {
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
                return PLUGIN_HANDLED;
            }
            
            if (!is_user_alive(id))
            {
                ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
                return PLUGIN_HANDLED;
            }
            
            if (cs_get_user_money(id) >= 4000 )
            {
                get_user_name(id, name, 31)
                ColorChat(0, GREEN, "%s ^x03-Buy a gravitation", name)
                set_user_gravity(id, 0.87)
                cs_set_user_money(id , cs_get_user_money(id) - 4000, 0)
            }
        }
        case 2 :
        {
            new name[32];
            
            if (cs_get_user_money(id) < 16000)
            {
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
                return PLUGIN_HANDLED;
            }
            
            if (!is_user_alive(id))
            {
                ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
                return PLUGIN_HANDLED;
            }
            
            if (cs_get_user_money(id) >= 16000 )
            {
                get_user_name(id, name, 31)
                ColorChat(0, GREEN, "%s ^x03-Buy a C4", name)
                give_item(id, "weapon_c4")
        cs_set_user_plant(id, 1, 1)
                cs_set_user_money(id , cs_get_user_money(id) - 16000, 0)
            }
        }
        case 3 :
        {
            new name[32];
            
            if (cs_get_user_money(id) < 14500)
            {
                get_user_name(id, name, 31)
                ColorChat(id, GREEN, "%s ^x03-Don't have enought money", name)
                return PLUGIN_HANDLED;
            }
            
            if (!is_user_alive(id))
            {
                ColorChat(id, GREEN, "%s ^x03-need to be alive", name)
                return PLUGIN_HANDLED;
            }
            
            if (cs_get_user_money(id) >= 14500 )
            {
                get_user_name(id, name, 31)
                ColorChat(0, GREEN, "%s ^x03-Buy a CT skin", name)
                precache_model("models\player\pipec\pipec.mdl")
                cs_set_user_money(id , cs_get_user_money(id) - 14500, 0)
            }
        }
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED;
 }

Last edited by zirualas; 08-12-2010 at 03:16.
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-12-2010 , 03:25   Re: Model problem
Reply With Quote #4

ALWAYS USE precache in public plugin_precache!!!
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 06:00   Re: Model problem
Reply With Quote #5

Check my error.
PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// testas.sma
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(1
23) : error 035argument type mismatch (argument 1)
//
// 1 Error.
// Could not locate output file C:\Program Files\Counter-strike\cstrike\addons\a
mxmodx\scripting\compiled\testas.amx (compile failed).
//
// Compilation Time: 0.08 sec
// ----------------------------------------

Press enter to exit ... 
Here my code.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>

#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /funbuy""FunBuy" );
    
register_clcmd"say_team /funbuy""FunBuy" );

}
    public  
plugin_precache ( )
    {
    
precache_model("models/player/pipec/pipec.mdl")
    }

public 
FunBuy(id)
{
    new 
menu menu_create("\gFun Buy Menu:""menu_handler");

    
menu_additem(menu"\w Low Gravity - \r4000""1"0);
    
menu_additem(menu"\w Buy C4 - \r16000""2"0);
    
menu_additem(menu"\w CT skin - \r14500""3"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
acesscallback;

    
menu_item_getinfo(menuitemacessdata,6iName63callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
//gravity
        
{
            new 
name[32];
            
            if (
cs_get_user_money(id) < 4000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 4000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a gravitation"name)
                
set_user_gravity(id0.87)
                
cs_set_user_money(id cs_get_user_money(id) - 40000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 16000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 16000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a C4"name)
                
give_item(id"weapon_c4")
        
cs_set_user_plant(id11)
                
cs_set_user_money(id cs_get_user_money(id) - 160000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 14500)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 14500 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a CT skin"name)
                
cs_set_user_model("pipec")
                
cs_set_user_money(id cs_get_user_money(id) - 145000)
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-12-2010 , 06:02   Re: Model problem
Reply With Quote #6

PHP Code:
 cs_set_user_model("pipec"
Ok, you are setting model, but on what?
Correct form:
PHP Code:
 cs_set_user_model(id,"pipec"
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 06:54   Re: Model problem
Reply With Quote #7

Thx man
zirualas is offline
Send a message via Skype™ to zirualas
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-12-2010 , 12:56   Re: Model problem
Reply With Quote #8

Note that the model will be resettet to normal at each spawn.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 13:48   Re: Model problem
Reply With Quote #9

So i need type cs_reset_user_model(id)? Or do something thith bool?
zirualas is offline
Send a message via Skype™ to zirualas
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 08-12-2010 , 14:25   Re: Model problem
Reply With Quote #10

He means, that every round model will be reseted itself to default, so you need to set it every round if you want it lasts longer than one round.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Reply


Thread Tools
Display Modes

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 21:50.


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