AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set model [chicken] (https://forums.alliedmods.net/showthread.php?t=133529)

Ex3cuTioN 07-26-2010 11:01

Set model [chicken]
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>

#pragma semicolon 1

new const g_Model[] = "models/chick.mdl";
new const 
g_Sound[] = "misc/chicken.wav";

new 
bool:g_HasModel[33];

public 
plugin_init() {
    
register_plugin("Chicken""0.1""Ex3cuTioN");
    
register_clcmd("say /chicken","cmdTransform");
}

public 
client_connect(id) {
    
g_HasModel[id] = false;
}

public 
client_disconnect(id) {
    
g_HasModel[id] = false;
}

public 
plugin_precache() {
    
precache_sound(g_Sound);
    
precache_model(g_Model);
}

public 
cmdTransform(id) {
    if(!
is_user_alive(id)) {
        
client_print(id,print_chat,"You must be alive");
    }
    
    if(
g_HasModel[id] == true) {
        
cs_reset_user_model(id);
        
g_HasModel[id] = false;
    }
    else if(
g_HasModel[id] == false) {
        
entity_set_model(idg_Model);
        
client_cmd(0,"spk %s",g_Sound);
        
g_HasModel[id] = true;
    }
    
client_print(id,print_chat,"You're a %s",g_HasModel[id] ? "chicken" "player");


It's not working...

minato 07-26-2010 11:17

Re: Set model [chicken]
 
PHP Code:

entity_set_model(idg_Model); 

:arrow:
PHP Code:

cs_set_user_model(id,g_Model


Ex3cuTioN 07-26-2010 11:18

Re: Set model [chicken]
 
Wrong

http://www.amxmodx.org/funcwiki.php?...odel&go=search

That's just for models/player/

And i tryed that too, and nothing :)

minato 07-26-2010 11:27

Re: Set model [chicken]
 
Quote:

Originally Posted by Ex3cuTioN (Post 1252049)
Wrong

http://www.amxmodx.org/funcwiki.php?...odel&go=search

That's just for models/player/

And i tryed that too, and nothing :)

PHP Code:

new const g_Model[] = "models/chick.mdl"

:arrow:
PHP Code:

new const g_Model[] = "models/player/chicken/chicken.mdl"

------------------------------
PHP Code:

entity_set_model(idg_Model); 

:arrow:
PHP Code:

cs_set_user_model(id"chicken"); 



All times are GMT -4. The time now is 00:18.

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