Raised This Month: $51 Target: $400
 12% 

Optimize this


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-21-2015 , 07:33   Optimize this
Reply With Quote #1

Is there a better way to do this whiout having to repeat the same code for each 'Bot_'?

Spoiler
Syturi0 is offline
Shiina.Mashiro
Senior Member
Join Date: Sep 2014
Location: Vietnam
Old 01-21-2015 , 09:24   Re: Optimize this
Reply With Quote #2

you can try this
PHP Code:
new bot[33]
for(new 
0<= numberofbotsi++)
{
     
bot[i] = engfunc(EngFunc_CreateFakeClientbotname[i])
     if(
bot[i] > 0)
     {
          
dllfunc(MetaFunc_CallGameEntity"player"bot[i])
          
set_pev(bot[i], pev_flagsFL_FAKECLIENT)
          
set_pev(bot[i], pev_model"")
          
set_pev(bot[i], pev_viewmodel2"")
          
set_pev(bot[i], pev_modelindex0)
          
set_pev(bot[i], pev_renderfxkRenderFxNone)
          
set_pev(bot[i], pev_rendermodekRenderTransAlpha)
          
set_pev(bot[i], pev_renderamt0.0)
          
cs_set_user_team(bot[i], CS_TEAM_UNASSIGNED)
     }

__________________
Shiina.Mashiro is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-21-2015 , 19:01   Re: Optimize this
Reply With Quote #3

Create a function and use that three times.
__________________

Last edited by fysiks; 01-21-2015 at 19:01.
fysiks is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 01-21-2015 , 21:10   Re: Optimize this
Reply With Quote #4

Quote:
Originally Posted by Shiina.Mashiro View Post
you can try this
PHP Code:
new bot[33]
for(new 
0<= numberofbotsi++)
{
     
bot[i] = engfunc(EngFunc_CreateFakeClientbotname[i])
     if(
bot[i] > 0)
     {
          
dllfunc(MetaFunc_CallGameEntity"player"bot[i])
          
set_pev(bot[i], pev_flagsFL_FAKECLIENT)
          
set_pev(bot[i], pev_model"")
          
set_pev(bot[i], pev_viewmodel2"")
          
set_pev(bot[i], pev_modelindex0)
          
set_pev(bot[i], pev_renderfxkRenderFxNone)
          
set_pev(bot[i], pev_rendermodekRenderTransAlpha)
          
set_pev(bot[i], pev_renderamt0.0)
          
cs_set_user_team(bot[i], CS_TEAM_UNASSIGNED)
     }

Thanks. It works.
Syturi0 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 09:28.


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