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

[HELP] How do I loop set_task for only a few seconds.


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-22-2018 , 13:21   Re: [HELP] How do I loop set_task for only a few seconds.
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
Since cs_get_user_team() returns a CsTeams type, you need to define the iPTeam variable as CsTeams. You were also missing a closing bracket. Natsheh, you should avoid calling cs_get_user_team() multiple times for the same player.

I didn't look at your code beyond this, not sure if it does what you expect. Give it a try.

Code:
public updatePlayerEconomy() {     new players[ 32 ] , playercount , player , player2 , szName[ 32 ]     new iPMoney , CsTeams:iPTeam[ 33 ];         get_players(players, playercount, "h");         for(new i ; i < playercount; i++)     {         player = players[i];                 if ( !iPTeam[ player ] )             iPTeam[ player ] = cs_get_user_team( player );                     if (CS_TEAM_T <= iPTeam[ player ] <= CS_TEAM_CT)         {             iPMoney = cs_get_user_money(player);             get_user_name(player, szName, charsmax(szName));                     for ( new j = 0 ; j < playercount ; j++ )             {                 player2 = players[j];                                 if ( !iPTeam[ player2 ] )                     iPTeam[ player2 ] = cs_get_user_team( player2 );                                     if ( iPTeam[ player ] == iPTeam[ player2 ] )                 {                     client_print( player2 , print_chat , "%s => $%d" , szName , iPMoney );                 }             }         }     } }
Well actually i didnt really compiled the code neither tested it, it was written on a phone..

The code should function correctly.

Btw goldnux remove the bracket "{" after continue; and its close
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-22-2018 at 14:23.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 21:20.


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