[Tutorial] Strcmp (OnPlayerCommandText) e Sscanf
#9

Quote:
Originally Posted by Coe1
Посмотреть сообщение
Nгo existe esse negуcio de prevenir. rs

Ex:
pawn Код:
COMMAND:sexo ( playerid, params[] ) {

    new
        MySex [ 10 ] ;
       
    if ( sscanf ( params, "s", MySex ) )
        return SendClientMessage ( playerid, -1, "[ USE ]: /sexo ( estilo )" ) ;
       
    if ( strcmp ( MySex, "estilo", true ) == 0 ) {
   
        ShowPlayerDialog ( playerid, 1000, DIALOG_STYLE_MSGBOX, "Menu do sexo", "Sexo '-'", #Cont, #Qt ) ;
    }
    return 1 ;
}
Eu tambйm nunca tive erros no console por esse motivo, mas se alguйm jб teve e, colocar o tamanho ou nгo, nгo faz diferenзa alguma, melhor colocar.

#Edit

Eu atualizei meu sscanf para a versгo 2.8.1 e tive esse erro no console:

[19:30:02] sscanf warning: Strings without a length are deprecated, please add a destination size.


Entгo sim, faz diferenзa colocar o length (tamanho) da string no format do sscanf.
Reply


Messages In This Thread
Strcmp (OnPlayerCommandText) e Sscanf - by Juniiro3 - 06.10.2013, 23:07
Re: Strcmp (OnPlayerCommandText) e Sscanf - by WLSF - 06.10.2013, 23:08
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Juniiro3 - 06.10.2013, 23:10
Re: Strcmp (OnPlayerCommandText) e Sscanf - by PT - 06.10.2013, 23:10
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Juniiro3 - 06.10.2013, 23:13
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Coe1 - 06.10.2013, 23:26
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Juniiro3 - 06.10.2013, 23:29
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Coe1 - 06.10.2013, 23:34
Re: Strcmp (OnPlayerCommandText) e Sscanf - by Juniiro3 - 06.10.2013, 23:37
Re: Strcmp (OnPlayerCommandText) e Sscanf - by mau.tito - 10.10.2013, 00:01

Forum Jump:


Users browsing this thread: 4 Guest(s)