Raised This Month: $32 Target: $400
 8% 

Loop Task or Flag B


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2022 , 18:57   Loop Task or Flag B
Reply With Quote #1

I have a doubt, wich is better, a loop for a task or setting a Flag B?

PHP Code:
for ( new Float:i=1.0i<=999.0i++ )
set_taski"fxLight"Client );  

// Or

set_task1.0"fxLight"Client__"b"); 
thinking it will be infinite until i decide to remove it

Last edited by MrPickles; 08-07-2022 at 18:58.
MrPickles is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-07-2022 , 19:17   Re: Loop Task or Flag B
Reply With Quote #2

1 repeating task is way better
jimaway is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2022 , 19:21   Re: Loop Task or Flag B
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
1 repeating task is way better
so the task with the flag b?

and other thing:

PHP Code:
new g_variable[33// 33 is the max array, for 32 players + 1 extra slot right?
                            // but if my server have 12 slots, shouldn't it be 13? 

Last edited by MrPickles; 08-07-2022 at 19:24.
MrPickles is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-07-2022 , 19:38   Re: Loop Task or Flag B
Reply With Quote #4

Quote:
Originally Posted by MrPickles View Post
so the task with the flag b?

and other thing:

PHP Code:
new g_variable[33// 33 is the max array, for 32 players + 1 extra slot right?
                            // but if my server have 12 slots, shouldn't it be 13? 
MAX_PLAYERS definition is not the same as MaxClients. MaxClients holds how many players the server can have at a particular time while MAX_PLAYERS is a constant that holds the maximum amount of players the server can have of clients.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2022 , 19:40   Re: Loop Task or Flag B
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
MAX_PLAYERS definition is not the same as MaxClients. MaxClients holds how many players the server can have at a particular time while MAX_PLAYERS is a constant that holds the maximum amount of players the server can have of clients.
so it will always be 33?
MrPickles is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 08-07-2022 , 21:09   Re: Loop Task or Flag B
Reply With Quote #6

Quote:
Originally Posted by MrPickles View Post
so it will always be 33?
yes, 33 is null, 0 is server and 1 to 32 are the players
__________________
bigdaddy424 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2022 , 21:20   Re: Loop Task or Flag B
Reply With Quote #7

Quote:
Originally Posted by bigdaddy424 View Post
yes, 33 is null, 0 is server and 1 to 32 are the players
but what I don't understand, you say that from 1 to 32 are the players, that is, 1 is the first to enter and so on, until reaching 32, but what if my server has a maximum capacity of 12 players? shouldn't it be minimized?
MrPickles is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-07-2022 , 22:12   Re: Loop Task or Flag B
Reply With Quote #8

This is what Natshed just told you about. But since we cannot change the variable size mid-game, we create them with the maximum value of players ID avaliable by the game, which is 32 players. Stick with the g_variable[33], changing to [13] won't change anything regarding your server perfomance or memory whatsoever.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 08-08-2022 at 02:34.
EFFx is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-07-2022 , 22:57   Re: Loop Task or Flag B
Reply With Quote #9

Quote:
Originally Posted by EFFx View Post
This is what Natshed just told you about. But since we cannot change the variable size mid-game, we create when with the maximum value of players ID avaliable by the game, which is 32 players. Stick with the g_variable[33], changing to [13] won't change anything regarding your server perfomance or memory whatsoever.
Thank U!
MrPickles 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 01:49.


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