Raised This Month: $ Target: $400
 0% 

Warn Other Players!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-19-2018 , 06:52   Re: Warn Other Players!
Reply With Quote #12

Quote:
Originally Posted by edon1337 View Post
Here's some optimization you could do to the code:
1.
PHP Code:
            if(warnedTimes[iPlayer] == 0){
                
warnedTimes[iPlayer]++;
            } else if(
warnedTimes[iPlayer] == 1){
                
warnedTimes[iPlayer]++;
            } else if(
warnedTimes[iPlayer] == 2){
                
warnedTimes[iPlayer]++; 
Instead of if() and else if() you could use switch().

2. You should specify a HUD time because default is 12 seconds
PHP Code:
set_hudmessage(02550, -1.0, -1.6
3.
Player name can't be longer than 32 characters, so you can use [32].
PHP Code:
idName[50
Thank you for your optimalization.
LemoNSK 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 20:47.


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