Raised This Month: $ Target: $400
 0% 

HLDM Random player model


Post New Thread Reply   
 
Thread Tools Display Modes
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-19-2013 , 20:18   Re: Half-Life deathmatch random player model
Reply With Quote #11

Quote:
Originally Posted by BodyBuilder View Post
show, i am band coder, i don't undarstand.
Go learn or ask for assistance in Scripting Help. If you cannot do these simple things, then you shouldn't be releasing plugins
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 01-20-2013 , 05:12   Re: Half-Life deathmatch random player model
Reply With Quote #12

I'm asking in scripting help but closed "read rules"

i updated plugin
BodyBuilder is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-20-2013 , 07:33   Re: Half-Life deathmatch random player model
Reply With Quote #13

Quote:
Originally Posted by BodyBuilder View Post
I'm asking in scripting help but closed "read rules"

i updated plugin

And you PMed me, you said :

Quote:
Originally Posted by BodyBuilder
how i can read rules if i understand english
So if you don't understand english, just use the "Other language" forums.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-20-2013 at 07:34.
ConnorMcLeod is offline
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 01-20-2013 , 13:19   Re: Half-Life deathmatch random player model
Reply With Quote #14

Quote:
Originally Posted by YamiKaitou View Post
Since you are already reading the file in plugin_precache, why not cache the contents and then select the random model from the cache?
posible set random model from pre cache ?
BodyBuilder is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2013 , 14:03   Re: HLDM Random player model
Reply With Quote #15

Ok, that's enough. You don't know what you're doing. Don't release again something until you have a decent knowledege. That's not our job to teach you how to code, you are supposed to know if you release a plugin here. If you want help/learn, check the scripting/tutorial section.


Redundant, poorly coded. Unapproved.
__________________

Last edited by Arkshine; 01-20-2013 at 14:04.
Arkshine is offline
Old 01-20-2013, 14:55
BodyBuilder
This message has been deleted by YamiKaitou. Reason: unneeded comments
Old 01-20-2013, 14:58
BodyBuilder
This message has been deleted by YamiKaitou. Reason: unneeded comments
Old 01-21-2013, 02:51
BodyBuilder
This message has been deleted by BodyBuilder.
Old 01-21-2013, 02:52
BodyBuilder
This message has been deleted by BodyBuilder.
Old 01-21-2013, 03:05
BodyBuilder
This message has been deleted by BodyBuilder.
BodyBuilder
BANNED
Join Date: Jun 2011
Location: Europa-USA-Moon
Old 01-21-2013 , 03:15   Re: HLDM Random player model
Reply With Quote #16

can give code ?
cache the contents and then select the random model from the cache

PHP Code:
#include amxmodx

#define PLUGIN "HLDM Random player model"
#define VERSION "0.0.2"
#define AUTHOR "BodyBuilder"

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

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

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)

        
read_file(MODELFILE,random(file_size(MODELFILE,1)),text,63,len)

        
strbreak(text,left,5,right,63)

        
set_user_info(id,"model",right)
    }
}

public 
plugin_precache()
{
    while((
line read_file(MODELFILE,line,text,63,len)))
    {
        
copy(string,5,text)

        if(
equali(string,"rpm* "))
        {
            
strbreak(text,left,5,right,63)
            
formatex(left,63,"models/player/%s/%s.mdl",right,right)

            if(!
file_exists(left)) 
            {
                
server_print("[HLDM-RPM]: could not find model %s to precache",left)
            }
                else 
            {
                
precache_model(left)
            }
        }
    }

BodyBuilder is offline
pupalamini
BANNED
Join Date: Jan 2013
Old 01-21-2013 , 06:24   Re: HLDM Random player model
Reply With Quote #17

Quote:
Originally Posted by BodyBuilder View Post
can give code ?
cache the contents and then select the random model from the cache

PHP Code:
#include amxmodx

#define PLUGIN "HLDM Random player model"
#define VERSION "0.0.2"
#define AUTHOR "BodyBuilder"

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

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

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)

        
read_file(MODELFILE,random(file_size(MODELFILE,1)),text,63,len)

        
strbreak(text,left,5,right,63)

        
set_user_info(id,"model",right)
    }
}

public 
plugin_precache()
{
    while((
line read_file(MODELFILE,line,text,63,len)))
    {
        
copy(string,5,text)

        if(
equali(string,"rpm* "))
        {
            
strbreak(text,left,5,right,63)
            
formatex(left,63,"models/player/%s/%s.mdl",right,right)

            if(!
file_exists(left)) 
            {
                
server_print("[HLDM-RPM]: could not find model %s to precache",left)
            }
                else 
            {
                
precache_model(left)
            }
        }
    }

just give my code

lamers !! baned
p.s sounds like fun
pupalamini 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 07:35.


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