Comando /kick nгo funcionando -
ViniciusTUF - 14.04.2016
Rapaziada eu coloquei esse comando /kick, mais quando vou testa ele nгo kika '-'
if(strcmp(cmdtext,"/kick",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1)
SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]");
return 1;
}
new kickado = strval(tmp);
new kickadoname[MAX_PLAYER_NAME];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]");
return 1;
}
GetPlayerName(kickado,kickadoname,sizeof(kickadona me));
format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}
Re: Alguйm ajuda aqui glr. -
zPain - 14.04.2016
Vocк esqueceu o mais importante: a funзгo
Kick no fim do comando.
Re: Alguйm ajuda aqui glr. -
SkyneTSAMP - 15.04.2016
@Post_Abaixo;
Re: Alguйm ajuda aqui glr. -
SkyneTSAMP - 15.04.2016
pawn Код:
if(strcmp(cmdtext,"/kick",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1)
SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]");
return 1;
}
new kickado = strval(tmp);
new kickadoname[MAX_PLAYER_NAME];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
if(!strlen(result))
{
SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]");
return 1;
}
GetPlayerName(kickado,kickadoname,sizeof(kickadona me));
format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result);
SendClientMessageToAll(0xFFFFFFAA,string);
Kick(kickado); // Esqueceu De Kickar O Player Que Foi Alvo Do Kick?? :D
return 1;
}
Re: Alguйm ajuda aqui glr. -
ViniciusTUF - 16.04.2016
Quote:
Originally Posted by SkyneTSAMP
pawn Код:
if(strcmp(cmdtext,"/kick",true) == 0) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pCbf] >= 1) SendClientMessage(playerid,0xFFFFFFAA,"Use /Kick [ID/Nome][Motivo]"); return 1; } new kickado = strval(tmp); new kickadoname[MAX_PLAYER_NAME]; new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[256]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } if(!strlen(result)) { SendClientMessage(playerid,BRANCO,"Use /Kick[ID][Motivo]"); return 1; } GetPlayerName(kickado,kickadoname,sizeof(kickadona me)); format(string,sizeof(string),"%s Foi Kickado Pelo %s %s, Motivo: %s",kickadoname,pNome(playerid),result); SendClientMessageToAll(0xFFFFFFAA,string); Kick(kickado); // Esqueceu De Kickar O Player Que Foi Alvo Do Kick?? :D return 1; }
|
error 017: undefined symbol "kickadona"
error 017: undefined symbol "me"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
4 erros '-'
Re: Alguйm ajuda aqui glr. -
ApocaSamp - 16.04.2016
Mas antes defina o ID
PHP код:
id = strval(tmp);
Kick(id);
Re: Alguйm ajuda aqui glr. -
ViniciusTUF - 16.04.2016
Quote:
Originally Posted by ApocaSamp
Mas antes defina o ID
PHP код:
id = strval(tmp);
Kick(id);
|
ISSO NO COMANDO?
Re: Alguйm ajuda aqui glr. -
ApocaSamp - 16.04.2016
PHP код:
if(strcmp(cmd, "/kick", true) == 0)
{
id = strval(tmp);
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,-1, "Uso: /kick [id do player] [motivo]");
return 1;
}
id = strval(tmp);
{
if(IsPlayerConnected(id))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[350];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
result = "N/A";
}
GetPlayerName(id, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s foi kickado pelo %s | Motivo: %s", giveplayer,sendername,result);
SendClientMessageToAll(-1, string);
Kick(id);
}
return 1;
}
Re: Comando /kick nгo funcionando -
SkyneTSAMP - 16.04.2016
Da Onde Vocк Tirou "kickadona"? Seria "kickado"..
pawn Код:
new kickado = strval(tmp);
Re: Comando /kick nгo funcionando -
ViniciusTUF - 17.04.2016
Quote:
Originally Posted by SkyneTSAMP
Da Onde Vocк Tirou "kickadona"? Seria "kickado"..
pawn Код:
new kickado = strval(tmp);
|
poderia colocar o code completo nгo entendir direito n