Raised This Month: $ Target: $400
 0% 

Will it work ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-03-2009 , 12:44   Will it work ?
Reply With Quote #1

will this code work ?

PHP Code:

    
new const Zombies[][] = {
        
"Zombie1",
        
"Zombie2",
        
"Zombie3"
    
};

    public 
fw_PlayerSpawn_Post(idclient)
    {
        if (!
is_user_alive(id))
            return 
HAM_IGNORED
        
        
static team;team get_user_team(id)
    
        if(
team == 1// Terrorist
        
{
                
strip_user_weapons(id)
         
cs_set_user_model(idzombies[random_num(0sizeof Zombies 1)]) 
DoviuX is offline
Send a message via Skype™ to DoviuX
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-03-2009 , 12:48   Re: Will it work ?
Reply With Quote #2

Show your full code chief.
__________________
Bugsy is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-03-2009 , 12:51   Re: Will it work ?
Reply With Quote #3

The part of code you showed? Yes.
__________________
xPaw is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-03-2009 , 12:53   Re: Will it work ?
Reply With Quote #4

PHP Code:
cs_set_user_model(idZombies[random_num(0sizeof Zombies 1)]) 
z --> Z
__________________
alan_el_more is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-03-2009 , 12:54   Re: Will it work ?
Reply With Quote #5

alan_el_more

thx and how can i precache these becouse i dont know how

PHP Code:
    new const gZombies[][] = {
        
"models/WM/Zombie1/Zombie1.mdl",
        
"models/WM/Zombie2/Zombie2.mdl",
        
"models/WM/Zombie3/Zombie3.mdl"
    
}; 
i tryed
PHP Code:
        for(new 0sizeof Zombiesi++)
            
precache_modelZombies] ); 
wont work.

Last edited by DoviuX; 10-03-2009 at 12:57.
DoviuX is offline
Send a message via Skype™ to DoviuX
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-03-2009 , 13:15   Re: Will it work ?
Reply With Quote #6

Zombies -> gZombies...
__________________
xPaw is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-03-2009 , 13:22   Re: Will it work ?
Reply With Quote #7

okey thanks.

Nice pic ;)
DoviuX is offline
Send a message via Skype™ to DoviuX
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-04-2009 , 07:17   Re: Will it work ?
Reply With Quote #8

Use plugin_prechace.

Code:
public plugin_precache () {     // Your precache_model stuff go here }

By the way, instead of using random_num(0, sizeof(Zombies) - 1), you can use random(sizeof(Zombies)) which has the exact same effect.

Last edited by vitorrd; 10-04-2009 at 07:19.
vitorrd is offline
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 22:39.


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