Problema! -
Domozinho - 04.01.2011
pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
new id[256], texto[256];
id = strtok(cmdtext, idx);
if (strlen(id) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
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++;
}
result[idx - offset] = EOS;
if (strlen(result) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
Kick(strval(id) );
GetPlayerName(playerid, nome, sizeof(nome) );
GetPlayerName(id, outro, sizeof(outro) );//Aqui й a linha 136.
format(texto, sizeof texto, "O administrador: %s kickou o jogador: %s pelo motivo de: %s", nome, outro, result);
SendClientMessageToAll(0xFFFFFFFF, texto);
return 1;
}
Vive dando este erro:
pawn Код:
(136) : error 035: argument type mismatch (argument 1)
Re: Problema! -
CyNiC - 04.01.2011
Troque para
pawn Код:
GetPlayerName(strval(id), outro, sizeof(outro) );
E coloque o
depois disso, se nгo vocк vai kikar e nгo vai ter como obter o nick dele.
Respuesta: Problema! -
ipsBruno - 04.01.2011
pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
new id[64], texto[64];
id = strtok(cmdtext, idx);
if (strlen(id) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if (strlen(result) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
static pid = strval(id);
Kick(pid);
GetPlayerName(playerid, nome, sizeof(nome) );
GetPlayerName(pid, outro, sizeof(outro) );//Aqui й a linha 136.
format(texto, sizeof texto, "O administrador: %s kickou o jogador: %s pelo motivo de: %s", nome, outro, result);
SendClientMessageToAll(0xFFFFFFFF, texto);
return 1;
}
Re: Problema! -
Domozinho - 04.01.2011
Obrigado!
Re: Problema! -
bugvip - 04.01.2011
domozinho qual o nome do ursinho da sua foto? *-*
Re: Problema! -
Domozinho - 04.01.2011
Domo, bom gente nгo esta pegando o nome do jogador kickado queria saber se tem como postar o que estб faltando por favor!
Re: Problema! -
-GooGle- - 04.01.2011
Fiz Agora, Toma Aqui: Edit : colocado Pegar Nome
pawn Код:
if(strcmp("/kick", cmdtext, true, 4) == 0)
{
new mandarnome[MAX_PLAYER_NAME];
GetPlayerName(playerid, mandarnome, sizeof(mandarnome));
new string[256];
new kickid[256];
kickid = KcmD(1, cmdtext);
new mandarnome2[MAX_PLAYER_NAME];
GetPlayerName(strval(kickid), mandarnome2, sizeof(mandarnome2));
if(!strlen(kickid))
{
SendClientMessage(playerid,Cor_Aqui,"Use: /kick [id]");
return 1;
}
format(string,sizeof(string),"%s Kickou %s do servidor",mandarnome,kickid);
SendClientMessageToAll(Cor_Aqui,string);
Kick(strval(kickid));
return 1;
}
Add isto no final do seu gm
pawn Код:
stock KcmD(param, cmdtext[])
{
new string[128], pos, var;
format(string, sizeof(string), "%s ", cmdtext);
while((pos = strfind(string, " ", true)) != -1) {
if(var == param) return string;
var++;
strdel(string, 0, pos + 1);
if(strcmp(string, " ", true, pos) == 0) goto end;
}
end:
string[0] = '\0';
return string;
}
Re: Problema! -
Domozinho - 04.01.2011
Continua a mesma coisa!
Re: Problema! -
TiagoPS - 04.01.2011
Quote:
Originally Posted by bugvip
domozinho qual o nome do ursinho da sua foto? *-*
|
й um mafagafo

й serio
Respuesta: Problema! -
ipsBruno - 04.01.2011
Haha,ele Kicka e Depois Pega o Nome.
Falta de atenзгo nй Gente?
pawn Код:
if(strcmp(cmd, "/kick", true) == 0)
{
new id[64], texto[64];
id = strtok(cmdtext, idx);
if (strlen(id) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if (strlen(result) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Use: /kick [playerid]");
static pid = strval(id);
GetPlayerName(playerid, nome, sizeof(nome) );
GetPlayerName(pid, outro, sizeof(outro) );//Aqui й a linha 136.
Kick(pid);
format(texto, sizeof texto, "O administrador: %s kickou o jogador: %s pelo motivo de: %s", nome, outro, result);
SendClientMessageToAll(0xFFFFFFFF, texto);
return 1;
}