[AJUDA] comando /kick nao funfa direito
#1

pqp galera
nгo faz o menor sentido...
ele kicka o jogador correto
porйm ao enviar a msg da string, ele nгo fala o nick do jogador!!


cуdigo:
PHP код:
if(strcmp(cmd"/kick"true)==0)
{
new 
string[208 MAX_PLAYER_NAME],PlayerN[MAX_PLAYERS],OtherN[MAX_PLAYERS];
if(
PlayerInfo[playerid][PlayerAdmin] <= 2) return SendClientMessage(playerid,COLOR_RED"Vocк nгo pode usar este comando !!!");
tmp strtok(cmdtextidx);
giveplayerid ReturnUser(tmp);
if(
PlayerInfo[playerid][PlayerAdmin] >= 3){
if(!
strlen(tmp)) return SendClientMessage(playeridCOLOR_WHITE""WHITE"USO: "GREEN"/kick {FF6200}[playerid] "WHITE"[MOTIVO]");
if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_BRIGHTRED"Vocк nгo pode kickar a sн prуprio !");
if(
PlayerInfo[playerid][PlayerAdmin] < PlayerInfo[giveplayerid][PlayerAdmin]) return SendClientMessage(playeridCOLOR_BRIGHTRED"Vocк nгo pode kickar um admin de level mais alto !");
if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_WHITE"ID Invбlida.");
if(
cmdtext[8] <= 6) return SendClientMessage(playeridCOLOR_RED"MOTIVO precisa ter mais que 6 caracteres!!");
Kick(giveplayerid);
GetPlayerName(playerid,PlayerN,sizeof(PlayerN));
GetPlayerName(giveplayerid,OtherN,sizeof(OtherN));
format(stringsizeof(string), ""BLUE"\"%s\""RED" foi kickado pelo Admin: "BLUE"\"%s\""RED" Motivo: %s"OtherNPlayerN,cmdtext[8]);
SendClientMessageToAll(COLOR_BRIGHTREDstring);
printf("\"%s\"Foi Kickado pelo Admin: \"%s\" Motivo: %s",OtherN,PlayerN,cmdtext[8]);
}
return 
1;

o que acontece:
Quote:

/kick 3 paroo noob

Quote:

""Foi Kickado pelo Admin: "Meu_Nick" Motivo: paroo noob

Reply
#2

mude de OtherN[MAX_PLAYERS]; para OtherN[MAX_PLAYER_NAME];
Reply
#3

Ele estб executando o "KICK" antes mesmo de mandar a mensagem, invertб. coloque a mensagem primeiro depois o Kick(giveplayerid);

deve ser isso
Reply
#4

pawn Код:
if(!strcmp(cmd, "/kick", true))
{
    if(PlayerInfo[playerid][PlayerAdmin] <= 2) return SendClientMessage(playerid,COLOR_RED, "Vocк nгo pode usar este comando !!!");
    new string[128],nome[MAX_PLAYER_NAME][2], id;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/kick [ID] [MOTIVO]");
    id = ReturnUser(tmp);
    if(id == playerid || id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "! Vocк nгo pode se kickar / ID Invбlido / Jogador offline");
    if(PlayerInfo[id][PlayerAdmin] > PlayerInfo[playerid][PlayerAdmin]) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Vocк nгo pode kickar um admin de level mais alto !");

    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' ')) idx++;
    new motivo[128], offset = idx
    while ((idx < length) && ((idx - offset) < (sizeof(motivo) - 1))) {
        motivo[idx - offset] = cmdtext[idx];
        idx++;
    }
    motivo[idx - offset] = EOS;
    if(!strlen(motivo)) return SendClientMessage(playerid, -1, "/kick ID MOTIVO !");

    GetPlayerName(playerid,nome[0],24);
    GetPlayerName(id,nome[1],24);

    format(string, sizeof(string), ""BLUE"\"%s\""RED" foi kickado pelo Admin: "BLUE"\"%s\""RED" Motivo: %s", nome[1], nome[0], motivo);
    SendClientMessageToAll(COLOR_BRIGHTRED, string);
    Kick(id);
    print(string);
    return 1;
}
Reply
#5

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
mude de OtherN[MAX_PLAYERS]; para OtherN[MAX_PLAYER_NAME];
se fosse isso, pq o PlayerN nгo estaria bugado tbm?


Quote:
Originally Posted by CocaC0la
Посмотреть сообщение
Ele estб executando o "KICK" antes mesmo de mandar a mensagem, invertб. coloque a mensagem primeiro depois o Kick(giveplayerid);

deve ser isso
que diferenзa faz a ordem? o nick do kara deveria estar armazenado dentro da string, e assim deveria permanecer, nгo!?

alguйm tem alguma + idйia?
Reply
#6

Cara,tipo,a unica coisa que voce uso para Definir o Nome nesse code que voce mandou,foi pra usar 208 + 24 de Strings...A nao ser que voce usa alguma Stock para Getar o Nome
Reply
#7

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
Cara,tipo,a unica coisa que voce uso para Definir o Nome nesse code que voce mandou,foi pra usar 208 + 24 de Strings...A nao ser que voce usa alguma Stock para Getar o Nome
tem isso la...
GetPlayerName(playerid,PlayerN,sizeof(PlayerN));
GetPlayerName(giveplayerid,OtherN,sizeof(OtherN));
Reply
#8

cara,tenta mudar de PlayerN[MAX_PLAYERS]; no Comeзo do Code para PlayerN[MAX_PLAYER_NAME];..faзa isso tbm com o OtherN.
Reply
#9

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
cara,tenta mudar de PlayerN[MAX_PLAYERS]; no Comeзo do Code para PlayerN[MAX_PLAYER_NAME];..faзa isso tbm com o OtherN.
ok.... alterei...
e...
obviamente...
o resultado foi o mesmo
ele fala o nick do admin mas nao de qm foi kickado...

novo ctrl+c+v do codigo:

PHP код:
if(strcmp(cmd"/kick"true)==0)
{
new 
string[208 MAX_PLAYER_NAME],PlayerN[MAX_PLAYER_NAME],OtherN[MAX_PLAYER_NAME];
if(
PlayerInfo[playerid][PlayerAdmin] <= 2) return SendClientMessage(playerid,COLOR_RED"Vocк nгo pode usar este comando !!!");
tmp strtok(cmdtextidx);
giveplayerid ReturnUser(tmp);
if(
PlayerInfo[playerid][PlayerAdmin] >= 3){
if(!
strlen(tmp)) return SendClientMessage(playeridCOLOR_WHITE""WHITE"USO: "GREEN"/kick {FF6200}[playerid] "WHITE"[MOTIVO]");
if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_BRIGHTRED"Vocк nгo pode kickar a sн prуprio !");
if(
PlayerInfo[playerid][PlayerAdmin] < PlayerInfo[giveplayerid][PlayerAdmin]) return SendClientMessage(playeridCOLOR_BRIGHTRED"Vocк nгo pode kickar um admin de level mais alto !");
if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_WHITE"ID Invбlida.");
if(
cmdtext[8] <= 6) return SendClientMessage(playeridCOLOR_RED"MOTIVO precisa ter mais que 6 caracteres!!");
Kick(giveplayerid);
GetPlayerName(playerid,PlayerN,sizeof(PlayerN));
GetPlayerName(giveplayerid,OtherN,sizeof(OtherN));
format(stringsizeof(string), ""BLUE"\"%s\""RED" foi kickado pelo Admin: "BLUE"\"%s\""RED" Motivo: %s"OtherNPlayerN,cmdtext[8]);
SendClientMessageToAll(COLOR_BRIGHTREDstring);
printf("\"%s\"Foi Kickado pelo Admin: \"%s\" Motivo: %s",OtherN,PlayerN,cmdtext[8]);
}
return 
1;

se alguйm tiver alguma idйia й bem vinda... ;\
Reply
#10

Quote:
Originally Posted by CocaC0la
Посмотреть сообщение
Ele estб executando o "KICK" antes mesmo de mandar a mensagem, invertб. coloque a mensagem primeiro depois o Kick(giveplayerid);

deve ser isso
pow oq ele falo nao tava certo mas ele passo mto perto
a resposta era meio obvia
mandava o kick antes de pegar o NICK (e nao apenas a msg) dгггг...

bom vlw galera :]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)