strcat dando erro -
zCyan - 18.07.2017
Galera esse code aqui ta dando erro, eu sei que tem coisa errada ai mais nгo consigo achar os erros.
PHP код:
CMD:rankg(playerid)
{
new string[3000],grove[100],ballas[100],aztecas[100],vagos[100],wanteds[100];
strcat(grove,"{00D900}Grove Street Families Matou: {FFFFFF}%d {00D900}Morreu {FFFFFF}%d {00D900}TOTAL: {FFFFFF}%d\n\n",GroveMatou,GroveMorreu,GroveTotal);
strcat(ballas,"{9900FF}Front Yard Ballas Matou: {FFFFFF}%d {9900FF}Morreu {FFFFFF}%d {9900FF}TOTAL: {FFFFFF}%d\n\n",BallasMatou,BallasMorreu,BallasTotal);
strcat(aztecas,"{2641FE}Varrios Los Aztecas Matou: {FFFFFF}%d {2641FE}Morreu {FFFFFF}%d {2641FE}TOTAL: {FFFFFF}%d\n\n",AztecasMatou,AztecasMorreu,AztecasTotal);
strcat(vagos,"{FFC801}Los Santos Vagos Matou: {FFFFFF}%d {FFC801}Morreu {FFFFFF}%d {FFC801}TOTAL: {FFFFFF}%d\n\n",VagosMatou,VagosMorreu,VagosTotal);
strcat(wanteds,"{FF0000}Los Santos WanTeDs Matou: {FFFFFF}%d {FF0000}Morreu {FFFFFF}%d {FF0000}TOTAL: {FFFFFF}%d\n",WantedsMatou,WantedsMorreu,WantedsTotal);
ShowPlayerDialog(playerid,DIALOG_RANKG,DIALOG_STYLE_MSGBOX,"{FFFFFF}Rank - Gangues",string,"Informado","");
return 1;
}
Re: strcat dando erro -
GuilhermeNunes - 18.07.2017
new string[
3000],
o limete maximo da string й
1250
#define DialogBoxEx 1
PHP код:
CMD:rank(playerid, params[])
{
new str[1250];
format(str, sizeof(str), "TEXTO", playerid);
strcat(playerid, "TEXTO");
strcat(playerid, "Texto");
ShowPlayerDialog(playerid, DialogBoxEx, DIALOG_STYLE_MSGBOX, "Cabeзalho", str, "Ok", "Cancelar");
return 1;
}
crie mais Srtcat e n tem isso de
strcar(grove, "");
strcat(ballas, "");
Re: strcat dando erro -
IlanZ - 18.07.2017
@removed
Nгo vi o terceiro parametro
Re: strcat dando erro -
MultiKill - 18.07.2017
Olhe os argumentos da funзгo
strcat, para o que vocк esta tentando fazer deve ser usado a funзгo
format para formatar e depois a funзгo strcat para juntar a string formata em uma string principal.
Exemplo:
PHP код:
new temp[50];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
new principal[128];
format(temp, sizeof temp, "Olб %s", name);
strcat(principal, temp);
strcat(principal, " bem vindo ao servidor.");
Re: strcat dando erro -
zCyan - 18.07.2017
Quote:
Originally Posted by GuilhermeNunes
new string[ 3000],
o limete maximo da string й 1250
#define DialogBoxEx 1
PHP код:
CMD:rank(playerid, params[])
{
new str[1250];
format(str, sizeof(str), "TEXTO", playerid);
strcat(playerid, "TEXTO");
strcat(playerid, "Texto");
ShowPlayerDialog(playerid, DialogBoxEx, DIALOG_STYLE_MSGBOX, "Cabeзalho", str, "Ok", "Cancelar");
return 1;
}
crie mais Srtcat e n tem isso de
strcar(grove, "");
strcat(ballas, "");
|
Vou testar!
Re: strcat dando erro -
zCyan - 18.07.2017
Quote:
Originally Posted by IlanZ
PHP код:
CMD:rankg(playerid)
{
new string[800];
strcat(string,"{00D900}Grove Street Families Matou: {FFFFFF}%d {00D900}Morreu {FFFFFF}%d {00D900}TOTAL: {FFFFFF}%d\n\n",GroveMatou,GroveMorreu,GroveTotal);
strcat(string,"{9900FF}Front Yard Ballas Matou: {FFFFFF}%d {9900FF}Morreu {FFFFFF}%d {9900FF}TOTAL: {FFFFFF}%d\n\n",BallasMatou,BallasMorreu,BallasTotal);
strcat(string,"{2641FE}Varrios Los Aztecas Matou: {FFFFFF}%d {2641FE}Morreu {FFFFFF}%d {2641FE}TOTAL: {FFFFFF}%d\n\n",AztecasMatou,AztecasMorreu,AztecasTotal);
strcat(string,"{FFC801}Los Santos Vagos Matou: {FFFFFF}%d {FFC801}Morreu {FFFFFF}%d {FFC801}TOTAL: {FFFFFF}%d\n\n",VagosMatou,VagosMorreu,VagosTotal);
strcat(string,"{FF0000}Los Santos WanTeDs Matou: {FFFFFF}%d {FF0000}Morreu {FFFFFF}%d {FF0000}TOTAL: {FFFFFF}%d\n",WantedsMatou,WantedsMorreu,WantedsTotal);
ShowPlayerDialog(playerid,DIALOG_RANKG,DIALOG_STYLE_MSGBOX,"{FFFFFF}Rank - Gangues",string,"Informado","");
return 1;
}
|
PHP код:
C:\Users\zCyan\Desktop\Servidor Atual\gamemodes\BCO.pwn(460) : error 035: argument type mismatch (argument 3)
C:\Users\zCyan\Desktop\Servidor Atual\gamemodes\BCO.pwn(461) : error 035: argument type mismatch (argument 3)
C:\Users\zCyan\Desktop\Servidor Atual\gamemodes\BCO.pwn(462) : error 035: argument type mismatch (argument 3)
C:\Users\zCyan\Desktop\Servidor Atual\gamemodes\BCO.pwn(463) : error 035: argument type mismatch (argument 3)
C:\Users\zCyan\Desktop\Servidor Atual\gamemodes\BCO.pwn(464) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.
Re: strcat dando erro -
zCyan - 18.07.2017
Quote:
Originally Posted by MultiKill
Olhe os argumentos da funзгo strcat, para o que vocк esta tentando fazer deve ser usado a funзгo format para formatar e depois a funзгo strcat para juntar a string formata em uma string principal.
Exemplo:
PHP код:
new temp[50];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof name);
new principal[128];
format(temp, sizeof temp, "Olб %s", name);
strcat(principal, temp);
strcat(principal, " bem vindo ao servidor.");
|
Funcionou! Obrigado mano
Re: strcat dando erro -
MrEdu - 19.07.2017
Код:
strcat(dest[], const source[], maxlenght (opcional))
Primeiro parвmetro, a string que vai guardar os valores das outras strings, a segunda vai ser a string a ser juntada a primeira, e a terceira й o tamanho mбximo (opcional) e nгo para valores flutuantes tipo o format
Strcat
Re: strcat dando erro -
Bruno13 - 19.07.2017
Quote:
Originally Posted by GuilhermeNunes
new string[3000],
o limete maximo da string й 1250
|
O limite mбximo de char de uma string em pawn й 1.610.612.735. Claro que na teoria, pois na prбtica cada char ocupa 1 byte, oq daria aproximadamente 1,6gb de armazenamento e antes que pudesse, daria crash por stack size insuficiente.
1250 nunca ouvi falar. A galera fala muito que й 1024 que estб na wiki, mas 1024 й o limite da Textdraw string, e nгo da string.