[Pedido] Tutorial de Format para Dialog Password
#1

@TOPICO RESOLVIDO PELO Mau_Tito
Reply
#2

PHP код:
#define DialogTeste ( 1 )
    
static
           
xCelulas 128 ],
        
xNome 20+],
        
xIP 16 ]
    ;
    
GetPlayerName playeridxNome21 ) ;
    
GetPlayerIp playeridxIP16 ) ;
    
format xCelulassizeof xCelulas ), "Olб seu nome й: %s seu ID й: %d seu IP й: %d seja bem vindo ao Forum SA-MP"xNomeplayeridxIP );
    
ShowPlayerDialog playeridDialogTesteDIALOG_STYLE_PASSWORD"Teste"xCelulas"Teste""Teste"); 
https://sampwiki.blast.hk/wiki/OnDialogResponse

https://sampwiki.blast.hk/wiki/Format
Reply
#3

Quote:
Originally Posted by iSmirnoff
Посмотреть сообщение
PHP код:
static
    
xCelulas 128 ] ;
format xCelulassizeof xCelulas ), "Olб seu nome й: %s seu ID й: %d seu IP й: %d seja bem vindo ao Forum SA-MP"pNameplayeridnгo sei oq por);
ShowPlayerDialog playeridDialogTesteDIALOG_STYLE_PASSWORD"Teste"xCelulas"Teste""Teste"); 
me explique as funзхes fera? nгo quero pegar coisa pronta kkkkk se puder claro vlw
Reply
#4

Editei lб,

Perae jaja te explico
Reply
#5

Quote:
Originally Posted by iSmirnoff
Посмотреть сообщение
PHP код:
#define DialogTeste ( 1 )
    
static
           
xCelulas 128 ],
        
xNome 20+],
        
xIP 16 ]
    ;
    
GetPlayerName playeridxNome21 ) ;
    
GetPlayerIp playeridxIP16 ) ;
    
format xCelulassizeof xCelulas ), "Olб seu nome й: %s seu ID й: %d seu IP й: %d seja bem vindo ao Forum SA-MP"xNomeplayeridxIP );
    
ShowPlayerDialog playeridDialogTesteDIALOG_STYLE_PASSWORD"Teste"xCelulas"Teste""Teste"); 
https://sampwiki.blast.hk/wiki/OnDialogResponse

https://sampwiki.blast.hk/wiki/Format
Tentei utilizar seu cуdigo e deu os seguintes erros:

pawn Код:
C:\Documents and Settings\Administrador\Desktop\[BRT]-New\gamemodes\MGM.pwn(357) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(358) : error 017: undefined symbol "xCelulas"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(358) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(358) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(358) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(358) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Na seguinte linhas:

pawn Код:
(357)   static
 (358)       xCelulas [ 128 ],
Reply
#6

@Double Post alguйm?
Reply
#7

Toda vez que vocк botar algum msg que tenha que exibir alguma var ela tem que ser formatada ,
pois as nativas do samp de msg nгo consegue fazer esta funзгo apenas formatando mesmo !
pawn Код:
static _var[100]; // variavel com string para msg
format(_var,sizeof(_var)," Olб seu nome й: %s seu ID й: %d seu IP й: %d seja bem vindo ao Forum SA-MP", pName, playerid);
ShowPlayerDialog(playerid, DialogTeste, DIALOG_STYLE_PASSWORD, "Nome do Dialog", _var, "OK", #); // o # eo segundo botгo
Reply
#8

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
Toda vez que vocк botar algum msg que tenha que exibir alguma var ela tem que ser formatada ,
pois as nativas do samp de msg nгo consegue fazer esta funзгo apenas formatando mesmo !
pawn Код:
static _var[100]; // variavel com string para msg
format(_var,sizeof(_var)," Olб seu nome й: %s seu ID й: %d seu IP й: %d seja bem vindo ao Forum SA-MP", pName, playerid);
ShowPlayerDialog(playerid, DialogTeste, DIALOG_STYLE_PASSWORD, "Nome do Dialog", _var, "OK", #); // o # eo segundo botгo

No caso entгo ele ficaria assim?:

pawn Код:
static
    _var [ 100 ],
        xNome[ 20+1 ],
        xIP[ 16 ]
        ;
    GetPlayerName ( playerid, xNome, 21 ) ;
    GetPlayerIp ( playerid, xIP, 16 ) ;
    format (_var, sizeof (_var), "{FF0066}Status da conta: {D4FF00}Registrado\nNick: %s\nID: %d\nIP: %d\n{2600FF}Nao Desrespeite as regras\n{FFFFFF}Digite sua senha para logar:", xNome, playerid, xIP );
    ShowPlayerDialog ( playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "{FFFF00}Bem vindo ao {FFFF00}Meu GM", _var, "Login", "Cancelar");
ou assim:

pawn Код:
static _var [ 100 ];
    new xNome[ 20+1 ], xIP[ 16 ];
    GetPlayerName ( playerid, xNome, 21 ) ;
    GetPlayerIp ( playerid, xIP, 16 ) ;
    format (_var, sizeof (_var), "{FF0066}Status da conta: {D4FF00}Registrado\nNick: %s\nID: %d\nIP: %d\n{2600FF}Nao Desrespeite as regras\n{FFFFFF}Digite sua senha para logar:", xNome, playerid, xIP );
    ShowPlayerDialog ( playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "{FFFF00}Login {FFFF00}Brasil Truck", _var, "Login", "Cancelar");


de qualquer forma que compilo dб esses erros:

pawn Код:
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : error 017: undefined symbol "_var"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

Deste modo esta correto!
pawn Код:
static _var [ 100 ],xNome[ 20+1 ],xIP[ 16 ];
    GetPlayerName ( playerid, xNome, 21 ) ;
    GetPlayerIp ( playerid, xIP, 16 ) ;
    format (_var, sizeof (_var), "{FF0066}Status da conta: {D4FF00}Registrado\nNick: %s\nID: %d\nIP: %d\n{2600FF}Nao Desrespeite as regras\n{FFFFFF}Digite sua senha para logar:", xNome, playerid, xIP );
    ShowPlayerDialog ( playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "{FFFF00}Bem vindo ao {FFFF00}Meu GM", _var, "Login", "Cancelar");
Nгo fique dando espaзo em seu code as vezes o erro pode ser ocorrido por isto!
Reply
#10

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
Deste modo esta correto!
pawn Код:
static _var [ 100 ],xNome[ 20+1 ],xIP[ 16 ];
    GetPlayerName ( playerid, xNome, 21 ) ;
    GetPlayerIp ( playerid, xIP, 16 ) ;
    format (_var, sizeof (_var), "{FF0066}Status da conta: {D4FF00}Registrado\nNick: %s\nID: %d\nIP: %d\n{2600FF}Nao Desrespeite as regras\n{FFFFFF}Digite sua senha para logar:", xNome, playerid, xIP );
    ShowPlayerDialog ( playerid, DialogLogin, DIALOG_STYLE_PASSWORD, "{FFFF00}Bem vindo ao {FFFF00}Meu GM", _var, "Login", "Cancelar");
Nгo fique dando espaзo em seu code as vezes o erro pode ser ocorrido por isto!
Ae tito, cara deu os seguintes erros:

pawn Код:
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : error 003: declaration of a local variable must appear in a compound block
C:\Documents and Settings\Administrador\Desktop\-New\gamemodes\MGM.pwn(357) : error 017: undefined symbol "_var"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\MGM.pwn(357) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrador\Desktop\[MGM]-New\gamemodes\(357) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)