Comando bugado. -
SukMathcuck - 23.01.2015
Alguйm pode me informar oque tem de errado nesse cуdigo? pois nгo й funcional afs..
pawn Code:
if (strcmp(cmd, "/banconta", true) == 0)
{
if (IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
return true;
}
if (PlayerInfo[playerid][pAdminStats] != 0 && PlayerInfo[playerid][pAdmin] <= 5)
{
SendClientMessage(playerid, COLOR_GRAD1,"ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
return true;
}
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USE: /banconta [Nome] [Motivo]");
return true;
}
new para1, level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (IsPlayerConnected(para1))
{
if (para1 != INVALID_PLAYER_ID)
{
VBanNick(playerid,para1,level); // Ban por nick
//playerid = Administrador que efetuou o ban
//para1 = Nick que sofreu o ban
//level = Motivo do ban
}
}
}
return true;
}
Mais o
level, aquiw no cуdigo й nъmeros e nгo letras, afs, oque faзo, e lembrando o
para1 й o nome da pessoa que vai ban off, e nгo caso esteja on, eu atй modifiquei mais bugo tudo afs.. voltei estaca 0
Re: Comando bugado. -
MultiKill - 23.01.2015
Use sscanf, ou se ainda nгo quiser aprender, vocк vai ter que se vira e pensar em um jeito de como usar uma
loop,
strfind e
strdel.
E se for "esperto" vai olhar os links da loop, strfind e strdel.
Usando as funзхes acima, basta sу pensar um pouco.
E se vocк for inteligente vai comeзar a usar um processador de comandos e sscanf.
Re: Comando bugado. -
SukMathcuck - 23.01.2015
Code:
C:\Documents and Settings\Administrador\Desktop\gamemode\gamemodes\123.pwn(41794) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrador\Desktop\gamemode\gamemodes\123.pwn(41789) : warning 204: symbol is assigned a value that is never used: "level"
C:\Documents and Settings\Administrador\Desktop\gamemode\gamemodes\123.pwn(67826) : warning 204: symbol is assigned a value that is never used: "string"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
pawn Code:
VBanNick(playerid,para1,level); //linha 41794
Re: Comando bugado. -
MultiKill - 23.01.2015
O terceiro parвmetro tem que ser uma string e nгo uma variбvel do tipo inteiro.
Como vocк usa uma funзгo que nгo sabe para que serve?
Strval
E como vocк usa uma funзгo sem saber quais sгo os tipos de parвmetros?
Se eu usar /banconta MultiKill teste 123
E no comando tiver uma mensagem:
"MultiKill baniu a conta MultiKill Motivo: ..."
Vai aparecer isso no motivo:
"MultiKill baniu a conta MultiKill Motivo: teste"
Em vez de aparecer teste 123
Re: Comando bugado. -
SukMathcuck - 23.01.2015
Nгo entendi..
Re: Comando bugado. -
MultiKill - 23.01.2015
Code:
VBanNick(playerid,nick[],motivo[]);
Exemplo:
pawn Code:
VBanNick(0,"MultiKill","Algum Motivo");
Um exemplo de colo vocк estб usando:
pawn Code:
VBanNick(0,"MultiKill", 123);
Modo Correto:
pawn Code:
VBanNick(0,"MultiKill","Algum Motivo");
Modo Incorreto:
pawn Code:
VBanNick(0,"MultiKill", 123);
Se vocк nгo percebe o erro por favor vai estudar o bбsico do pawn.
Re: Comando bugado. -
SukMathcuck - 23.01.2015
Eu nгo entendo mais й nada! eu fiz do modo certo e o trem fala que nгo estб em uso, quebrei a cabeзa e nada saiu, afs..
Code:
C:\Documents and Settings\Administrador\Desktop\gamemode\gamemodes\BSL.pwn(41810) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\Administrador\Desktop\gamemode\gamemodes\BSL.pwn(41809) : warning 204: symbol is assigned a value that is never used: "level"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
pawn Code:
if (strcmp(cmd, "/banconta", true) == 0)
{
if (IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "ERRO: Vocк nгo tem nнvel administrativo suficiente.");
return true;
}
if (PlayerInfo[playerid][pAdminStats] != 0 && PlayerInfo[playerid][pAdmin] <= 5)
{
SendClientMessage(playerid, COLOR_GRAD1,"ERRO: Vocк nгo estб no modo admin! (/trabalhar)");
return true;
}
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USE: /banconta [Nome] [Motivo]");
return true;
}
new level;
level = strval(tmp); //> error linha 41809
VBanNick(playerid,tmp,level); // Ban por nick >> erro linha 41810 afs
//playerid = Administrador que efetuou o ban
//para1 = Nick que sofreu o ban
//level = Motivo do ban
}
return true;
}
Re: Comando bugado. -
MultiKill - 23.01.2015
A variбvel level armazena o que? nъmeros ou strings?
Re: Comando bugado. -
SukMathcuck - 23.01.2015
Quote:
Originally Posted by MultiKill
A variбvel level armazena o que? nъmeros ou strings?
|
strings: letras.
Re: Comando bugado. -
MultiKill - 23.01.2015
Errado. Armazena nъmeros:
Olhe isto:
Variбveis
Strings
E a funзгo
strval faz o que?