Raised This Month: $ Target: $400
 0% 

Change user skin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-04-2016 , 15:19   Re: Change user skin
Reply With Quote #4

Quote:
Originally Posted by EFFx View Post
If is for all players, add:

PHP Code:
set_task(3.0,"models")

public 
models()
{
       new 
players[32],inum
       get_players
(players,inum,"a")
       for(new 
0;i<inum;i++)
       {
            if(
cs_get_user_team(players[i]]) == CS_TEAM_T)
            {
                    
cs_set_user_model(players[i], "vermelho_ws")
            }
            else if(
cs_get_user_team(players[i]) == CS_TEAM_CT)
            {
                   
cs_set_user_model(players[i],"azul_ws")
            }
      }

Yes, it's better , no need to make task for every player but you missed something.

At the topic of the plugin :

PHP Code:
#define TASK_SETMODEL 5632 //or any numbers you want 
then :

PHP Code:
if(task_exists(TASK_SETMODEL))
remove_task(TASK_SETMODEL)
set_task(3.0,"models"TASK_SETMODEL

And you can use :

PHP Code:
switch(cs_get_user_team(players[i]){
case 
CS_TEAM_Tcs_set_user_model(players[i], "vermelho_ws")
case 
CS_TEAM_CTcs_set_user_model(players[i],"azul_ws")

It wont call function cs_get_user_team 2 times if first returns false.
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