Erro no codigo -
henrique22157 - 05.03.2018
bom galera estou com um erro aki alguem ajuda pfv
PHP код:
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string, "OK", ""); // Linha do erro
PHP код:
dcmd_facplayers(playerid, params[])
{
#pragma unused params
new playersCMD, playersLLL, players3CP, playersMLC;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 1 || Player[i][pFaccoes] == 2 || Player[i][pFaccoes] == 3)
{playersCMD ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 4 || Player[i][pFaccoes] == 5 || Player[i][pFaccoes] == 6)
{playersLLL ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 7 || Player[i][pFaccoes] == 8 || Player[i][pFaccoes] == 9)
{players3CP ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 10 || Player[i][pFaccoes] == 11 || Player[i][pFaccoes] == 12)
{playersMLC ++;}
}
new STring[4000], string1[4000];
format(STring, -1, "CMD» %d players online.", playersCMD);
strcat(string1,STring);
format(STring, -1, "LLL» %d players online.", playersLLL);
strcat(string1,STring);
format(STring, -1, "TD3» %d players online.", players3CP);
strcat(string1,STring);
format(STring, -1, "MLC» %d players online.", playersMLC);
strcat(string1,STring);
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string, "OK", ""); // Linha do erro
return 1;
}
Код:
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique.pwn(22786) : error 035: argument type mismatch (argument 3)
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique.pwn(28231) : warning 203: symbol is never used: "PosCX"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Erro no codigo -
[BOPE]Seu._.Madruga - 05.03.2018
Cade as linhas que sгo referentes aos erros ?
Re: Erro no codigo -
henrique22157 - 05.03.2018
Quote:
Originally Posted by [BOPE]Seu._.Madruga
Cade as linhas que sгo referentes aos erros ?
|
PHP код:
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string, "OK", ""); // Linha do erro
Re: Erro no codigo -
SrDivuOfficial - 05.03.2018
Olha pelo que eu vi vocк nao deveria usar assim
new STring[4000], string1[4000];
format(STring, -1, "CMD» %d players online.", playersCMD);
strcat(string1,STring);
format(STring, -1, "LLL» %d players online.", playersLLL);
strcat(string1,STring);
format(STring, -1, "TD3» %d players online.", players3CP);
strcat(string1,STring);
format(STring, -1, "MLC» %d players online.", playersMLC);
strcat(string1,STring);
ShowPlayerDialog(playerid, DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string1, "OK", "");
porque disso ?
pelo que eu intendi.
й que nгo esta encontrando nenhuma dialog sendo usada pela string e sim sendo formatada pela STRing e sendo usada pelo string1
ou seja dentro deste if ou comando nгo tem nenhuma dialog sendo usada como string, entao pode ser isso, se nгo for poste o que deu aqui
Re: Erro no codigo -
zG - 05.03.2018
PHP код:
dcmd_facplayers(playerid, params[])
{
new playersCMD, playersLLL, players3CP, playersMLC;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pFaccoes] == 1 || PlayerInfo[i][pFaccoes] == 2 || PlayerInfo[i][pFaccoes] == 3)
{playersCMD ++;}
if(IsPlayerConnected(i) && PlayerInfo[i][pFaccoes] == 4 || PlayerInfo[i][pFaccoes] == 5 || PlayerInfo[i][pFaccoes] == 6)
{playersLLL ++;}
if(IsPlayerConnected(i) && PlayerInfo[i][pFaccoes] == 7 || PlayerInfo[i][pFaccoes] == 8 || PlayerInfo[i][pFaccoes] == 9)
{players3CP ++;}
if(IsPlayerConnected(i) && PlayerInfo[i][pFaccoes] == 10 || PlayerInfo[i][pFaccoes] == 11 || PlayerInfo[i][pFaccoes] == 12)
{playersMLC ++;}
}
new STring[4000], string1[4000];
format(STring, -1, "CMD» %d players online.", playersCMD);
strcat(string1,STring);
format(STring, -1, "LLL» %d players online.", playersLLL);
strcat(string1,STring);
format(STring, -1, "TD3» %d players online.", players3CP);
strcat(string1,STring);
format(STring, -1, "MLC» %d players online.", playersMLC);
strcat(string1,STring);
ShowPlayerDialog(playerid, 666 , DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string1, "OK", "");
return 1;
}
Re: Erro no codigo -
IgorLuiz - 05.03.2018
Nгo й necessбrio usar 4000 cйlulas para isso, use 256, recomendo olhar alguns tutoriais sobre isso.
Код:
new STring[4000], string1[4000];
no seu codigo estava faltando definir o ID de sua dialog,
Код:
ShowPlayerDialog(playerid, 1,DIALOG_STYLE_MSGBOX,
Use assim.
PHP код:
dcmd_facplayers(playerid, params[])
{
#pragma unused params
new playersCMD, playersLLL, players3CP, playersMLC;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 1 || Player[i][pFaccoes] == 2 || Player[i][pFaccoes] == 3)
{playersCMD ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 4 || Player[i][pFaccoes] == 5 || Player[i][pFaccoes] == 6)
{playersLLL ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 7 || Player[i][pFaccoes] == 8 || Player[i][pFaccoes] == 9)
{players3CP ++;}
if(IsPlayerConnected(i) && Player[i][pFaccoes] == 10 || Player[i][pFaccoes] == 11 || Player[i][pFaccoes] == 12)
{playersMLC ++;}
}
new STring[256], string1[256];
format(STring, -1, "CMD» %d players online.", playersCMD);
strcat(string1,STring);
format(STring, -1, "LLL» %d players online.", playersLLL);
strcat(string1,STring);
format(STring, -1, "TD3» %d players online.", players3CP);
strcat(string1,STring);
format(STring, -1, "MLC» %d players online.", playersMLC);
strcat(string1,STring);
ShowPlayerDialog(playerid, 1,DIALOG_STYLE_MSGBOX, "Todas facзхes do servidor", string, "OK", ""); // Linha do erro
return 1;
}
Re: Erro no codigo -
JohnBlack - 05.03.2018
Henrique, o erro em seu cуdigo й que vocк estб utilizando mal a funзгo ShowPlayerDialog
Vocк deve respeitar todos os parвmetros
Estude pela wiki (
https://sampwiki.blast.hk/wiki/ShowPlayerDialog)
Veja que vocк estб pulando o parвmetro "dialogid".
Caso vocк nгo entenda o que й este parвmetro ou para que serve, procure um tutorial aqui no fуrum para que possa entender.
Espero ter ajudado
Re: Erro no codigo -
PilateGR - 05.03.2018
Tenta ai agora amigo!
PHP код:
dcmd_facplayers(playerid, params[])
{
#pragma unused params
new
CounTList[1000],
CounTDialog[800],
CounTeamCMD,
CounTeamLLL,
CounTeam3CP,
CounTeamMLC
;
for(new i = 0; i < MAX_PLAYERS; i ++)
{
switch(Player[i][pFaccoes] && IsPlayerConnected(i))
{
case 1..3:
CounTeamCMD ++;
case 4..6:
CounTeamLLL ++;
case 7..9:
CounTeam3CP ++;
case 10..12:
CounTeamMLC ++;
}
format(CounTDialog, sizeof(CounTDialog), "(CMD): Tem %i Players Online.\n", CounTeamCMD, strcat(CounTList, CounTDialog));
format(CounTDialog, sizeof(CounTDialog), "(LLL): Tem %i Players Online.\n", CounTeamLLL, strcat(CounTList, CounTDialog));
format(CounTDialog, sizeof(CounTDialog), "(3CP): Tem %i Players Online.\n", CounTeam3CP, strcat(CounTList, CounTDialog));
format(CounTDialog, sizeof(CounTDialog), "(MLC): Tem %i Players Online.\n", CounTeamMLC, strcat(CounTList, CounTDialog));
ShowPlayerDialog(playerid, 700, DIALOG_STYLE_MSGBOX, "Facзхes Online:", CounTList, "Fechar", #);
}
return true;
}
@EDIT
Melhorei mнnimos detalhes e tambйm fiz o mбximo de otimizaзгo possнvel. Tambйm quero deixar claro que nгo foi testado