Something wrong with /kick
#1

Today I kicked other player from my server, I did /kick 0 ADK and it displays, [AOF]Jakku (Me) has been kicked from the server for: ADK. But I didnt got kicked. Other player got kicked but my name displays in message. Strange...


Why it shows my name, there could be read [GLA]General


Reply
#2

Well it's useless unless you show us your kick script, it could be any number of errors..
Reply
#3

Here


Код:
	
if(strcmp(cmdtext, "/kick", true, 5)==0)
{
  if(!IsPlayerAdmin(playerid)) return 0;
  if(!strlen(cmdtext[6]))
  {
    SendClientMessage(playerid, COLOR_ORED, "Usage: /kick [playerid] [reason]");
    return 1;
  }
  new ID = strval(cmdtext[6]);
  new pName[24], str[64];
  if(IsPlayerConnected(ID))
  {
    GetPlayerName(playerid, pName, 24);
    format(str, 64, "%s has been kicked from the server for: %s", pName,rest);
    SendClientMessageToAll(COLOR_ORED, str);
    print("Player kicked");
    Kick(ID);
  }
  return 1;
}
Reply
#4

Your using playerid instead of ID.

playerid = the one who is executing the command
ID = the victim of the command.

Replace your GetPlayerName with this one.

pawn Код:
GetPlayerName(ID, pName, 24);
Reply
#5

I try that
Reply
#6

Use ReturnUser, it's better than what you are using now, also with ReturnUser you can do
/kick name reason
/kick MenaceX AFK
Reply
#7

TIP: use DCMD + SSCANF, it's 100x better/easier once you learn it.
Reply
#8

Quote:
Originally Posted by Mikkel
TIP: use DCMD + SSCANF, it's 100x better/easier once you learn it.
And you see that he doesn't use dcmd..
Why should he change his whole command now?
Reply
#9

Thank you Mikkel, that first post helped me. Same Problem was in my /ban command but now it works
Reply
#10

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by Mikkel
TIP: use DCMD + SSCANF, it's 100x better/easier once you learn it.
And you see that he doesn't use dcmd..
Why should he change his whole command now?
It really is way easier to understand DCMD and SSCANF, instead of understanding STRTOK, thats how i personally feel... anyways, back to topic, glad i could help ya buddy .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)