Raised This Month: $ Target: $400
 0% 

why ? how ?


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 01-19-2013 , 16:42   why ? how ?
#1

why code set one model from the bottom in models.ini
how set all random model from models.ini

PHP Code:
#include amxmodx

#define PLUGIN "player model"
#define VERSION "0.0.1"
#define AUTHOR "author unknown anonym"

#define MODELFILE "addons/amxmodx/configs/models.ini"

new linetext[64], lenleft[64], right[64], string[4]

#define WHILE while((line = read_file(MODELFILE,line,text,63,len)))

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id
{
    
set_task(1.00,"ChangeModel",id)
}

public 
ChangeModel(id
{
    if(
is_user_alive(id)) 
    {
        
remove_task(id)

        WHILE
        {
            
random_num(1,strbreak(text,left,3,right,63))
            
set_user_info(id,"model",right)
        }
    }
}

public 
plugin_precache() 
{
    WHILE
    {
        
copy(string,3,text)

        if(
equali(string,"P* ")) 
        {
            
strbreak(text,left,3,right,63)
            
format(left,63,"models/player/%s/%s.mdl",right,right)

            
precache_model(left)
        }
    }


models.ini

Code:
P* giraffe
P* batman
P* bertas
P* bobbit
P* carvino
P* first
P* giggles
P* grinch
P* limpo
P* pheonix
P* ronny
P* scream
P* scuba
P* slipknot
P* turgeon
P* sheeeit

Last edited by BodyBuilder; 01-19-2013 at 16:55.
BodyBuilder is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-19-2013 , 17:24   Re: why ? how ?
#2

Please read rules

https://forums.alliedmods.net/misc.php?do=showrules
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Closed Thread



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 13:26.


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