Raised This Month: $ Target: $400
 0% 

Can anyone check if there is a better way to do this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lexzor
Veteran Member
Join Date: Nov 2020
Old 08-08-2022 , 05:57   Re: Can anyone check if there is a better way to do this?
Reply With Quote #7

some changes i will do
PHP Code:
switch(g_iUserColor[player])
{
    case 
1:
    {
        
0;
        
255;
        
255;
    }

    case 
2:
    {
        
255;
        
0;
        
0;
    }

    
//and so on..

PHP Code:
formatexszTextcharsmaxszText ), "%L %L"player"ML_HUDPREFIX"playerg_szHudMenu[g_iUserColorplayer ]][1] ); 
to

PHP Code:
formatexszTextcharsmaxszText ), "%l %l""ML_HUDPREFIX"g_szHudMenu[g_iUserColorplayer ]][1] ); 
PHP Code:
nvault_getg_iVaultszKeyszDatacharsmaxszData ) );
        
    
parseszDataszDataPieces], charsmaxszDataPieces[ ] ), szDataPieces], charsmaxszDataPieces[ ] ), szDataPieces], charsmaxszDataPieces[ ] ) );
        
    
g_iUserColoriPlayer ] = str_to_numszDataPieces] );
    
g_iHudLcriPlayer ] =  str_to_numszDataPieces] );
    
g_iHudUcdiPlayer ] = str_to_numszDataPieces] ); 
to

PHP Code:
new iTs;
    if(
nvault_lookup(g_iVaultszKeyszDatacharsmax(szData), iTs))
    {
        
parseszDataszDataPieces], charsmaxszDataPieces[ ] ), szDataPieces], charsmaxszDataPieces[ ] ), szDataPieces], charsmaxszDataPieces[ ] ) );
        
g_iUserColoriPlayer ] = str_to_numszDataPieces] );
        
g_iHudLcriPlayer ] =  str_to_numszDataPieces] );
        
g_iHudUcdiPlayer ] = str_to_numszDataPieces] );
    } 
PHP Code:
menu_displayplayeriMenu ); 
to
PHP Code:
if(is_user_connected(id))
      
menu_displayplayeriMenu ); 
you don t need these if you are using new menus
PHP Code:
register_menucmd(register_menuid("Show_HudMenu")(1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "Handle_HudMenu");

iKeys |= (1<<1|1<<2|1<<3|1<<4); 
and
PHP Code:
new R,G,B,X,Y
should be declared as static

PHP Code:
static R,G,B,X,Y
Code:
Warning: Function "ChooseTeam" should return a value on line 2096
Warning: Function "Show_HudMenu" should return a value on line 2631
Warning: Function "Show_HudMenu" should return a value on line 2636
Warning: Function "Show_HudMenu" should return a value on line 2641
Warning: Function "Show_HudMenu" should return a value on line 2658
just add a return value at the end of the function

Code:
Warning: Tag mismatch on line 641
Warning: Tag mismatch on line 642
Warning: Tag mismatch on line 649
Warning: Tag mismatch on line 651
Warning: Tag mismatch on line 653
Warning: Tag mismatch on line 687
Warning: Tag mismatch on line 689
Warning: Tag mismatch on line 691
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 695
Warning: Tag mismatch on line 1394
this error appears when you give a variable a different type of value than the purpose in which the variable was created
example

you have a boolean variabile but you store in that variabile a int number
lexzor 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 15:41.


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