Raised This Month: $ Target: $400
 0% 

Optimizing 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 , 15:33   Re: Optimizing Code
Reply With Quote #2

why not using unidimenaional array?

new g_channel[33]

then you just do:

if(g_channel[id] < 3){
//do something
g_channel[id]++
set_task(1.5, "reset_channel", id)
}

public reset_channel(id){
if(g_channel[id])
g_channel[id]--;
}

Every time player uses command it will add 1 ,and when it will be 3 then he won't be able to use , he will wait for task to decrease the value.

Last edited by siriusmd99; 05-31-2016 at 15:33.
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:43.


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