Problem with sscanf2 params command
#1

Hello to all,

I have next problem,
Example: I have command /askq, but when i type /askq example: come to me, it send me return with message "/askq [Text]"

I have newest, sscanf2 plugin, also there is not any errors or warnings

COMMAND:
PHP код:
CMD:askqplayeridparams[] ) {
    if( 
PlayerCuffedplayerid ] >= ) return GRESKAplayerid"Ne mozes koristiti komandu kad si cuffovan ili tazovan.");
    if( 
PlayerInfoplayerid ][ pJailed ] != ) return GRESKAplayerid"Ne mozes da koristis ovu komandu dok si u zatvoru." );
    if( 
PlayerInfoplayerid ][ pMuted ] != 0) return GRESKAplayerid"Ne mozete pricati, usutkani ste.");
    if( 
askqInfoplayerid ][ askqSended ] == true ) return GRESKAplayerid"Vec si poslao pitanje, nije vam odgovoreno ili nisi pogledao." );
    new 
textic128 ];
    if( 
sscanfparams"d"textic )) return SendClientMessageplayerid"/askq[ Text ]" );
    new 
askQ = -1;
    for( new 
id 1id MAX_ASKQSid++ ) {
        if( 
askqListid ][ askqSend ] == false ) {
            
askQ id;
            break;
        }
    }
    if( 
askQ == -) return GRESKAplayerid"Vec ima maksimalan broj poslatih pitanja." );
    
askqListaskQ ][ askqSend ] = true;
    
askqListaskQ ][ askqID ] = playerid;
    
askqInfoplayerid ][ askqSended ] = true;
    
askqInfoplayerid ][ askqAnswered ] = false;
    
strmidaskqListaskQ ][ askqOwner ], GetNameplayerid ), 0strlenGetNameplayerid ) ), 32 );
    
strmidaskqListaskQ ][ askqQuestion ], textic0strlentextic ), 128 );
    
SendInfoMessageplayerid"Poslao si pitanje Adminima i Helperima." );
    new 
stringic128 ];
    
formatstringicsizeofstringic ), ""COL_RED"|P| %s je poslao pitanje.( /lp )"GetName(playerid) );
    
RPTChat( -1stringic );
    return 
1;

Reply
#2

Quote:
Originally Posted by RoX123
Посмотреть сообщение
I have newest, sscanf2 plugin, also there is not any errors or warnings
so what's problem?
Reply
#3

PHP код:
if( sscanfparams"d"textic )) return SendClientMessageplayerid"/askq[ Text ]" ); 
"d" is for integers and s is for strings, You have to use s there as text is not only integer.
Reply
#4

Quote:
Originally Posted by Inn0cent
Посмотреть сообщение
PHP код:
if( sscanfparams"d"textic )) return SendClientMessageplayerid"/askq[ Text ]" ); 
"d" is for integers and s is for strings, You have to use s there as text is not only integer.
Fixed! Thank you, rep+
Reply
#5

Quote:
Originally Posted by Inn0cent
Посмотреть сообщение
PHP код:
if( sscanfparams"d"textic )) return SendClientMessageplayerid"/askq[ Text ]" ); 
"d" is for integers and s is for strings, You have to use s there as text is not only integer.
And don't forget to add between "[]" the string's size. Example:
PHP код:
sscanf(params"s[24]"player_name
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)