AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   why ? how ? (https://forums.alliedmods.net/showthread.php?t=206204)

BodyBuilder 01-19-2013 16:42

why ? how ?
 
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


ConnorMcLeod 01-19-2013 17:24

Re: why ? how ?
 
Please read rules

https://forums.alliedmods.net/misc.php?do=showrules


All times are GMT -4. The time now is 13:26.

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