Raised This Month: $ Target: $400
 0% 

attempting to optimize code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-31-2016 , 09:50   Re: attempting to optimize code
Reply With Quote #5

No , it's not correct.
You are checking if equal to 200 but it can be more than 200 . He will have model only when has level 200 but no 201...
And use cs_get_user_team instead, it returns correct teams.
And why do you use g_isalive? Use directly is_user_alive , it's library native and is faster then plugin array.


PHP Code:
if (is_user_alive(id))
{
  if(
g_level[id] < 99)
  return;
  new 
pmodel[11];
  
formatex(pmodel7"Model_%s"g_level[id] >= 200 "2" "1" )
  
  switch(
cs_get_user_team(id))
  {
    case 
CS_TEAM_Tadd(pmodel9"_T");
    case 
CS_TEAM_CTadd(pmodel10"_CT");
    default: return;
  }
  
cs_set_player_model(idpmodel

siriusmd99 is offline
 



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 18:39.


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