SA-MP Forums Archive
Something wrong with /kick - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Something wrong with /kick (/showthread.php?tid=77358)



Something wrong with /kick - Jakku - 10.05.2009

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





Re: Something wrong with /kick - Weirdosport - 10.05.2009

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


Re: Something wrong with /kick - Jakku - 10.05.2009

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;
}



Re: Something wrong with /kick - shitbird - 10.05.2009

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);



Re: Something wrong with /kick - Jakku - 10.05.2009

I try that


Re: Something wrong with /kick - MenaceX^ - 10.05.2009

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


Re: Something wrong with /kick - shitbird - 10.05.2009

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


Re: Something wrong with /kick - MenaceX^ - 10.05.2009

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?


Re: Something wrong with /kick - Jakku - 10.05.2009

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


Re: Something wrong with /kick - shitbird - 10.05.2009

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 .