SA-MP Forums Archive
/kick id [Reason] - 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: /kick id [Reason] (/showthread.php?tid=129175)



/kick id [Reason] - juuleman - 21.02.2010

Hey GuyZ,
I made this topic cause my other one wasnt really responding..

Does someone have a good /kick script?
Cause i have a good one but it doesnt have a 'Reason', so does anyone have a /kick id reason script?

Please post.

Thanks


Re: /kick id [Reason] - Correlli - 21.02.2010

You can find it in many admin scripts if you want just an example.


Re: /kick id [Reason] - juuleman - 21.02.2010

I tried very much admin scripts and pasted it into my script but i got errors with all scripts..


Re: /kick id [Reason] - Burridge - 21.02.2010

https://sampwiki.blast.hk/wiki/Strtok

Doesn't have reason, but it might help you and you may be able to make your own reason.


Re: /kick id [Reason] - [LSR]State_Trooper - 21.02.2010

Here's Mine, I use Teams aswell as Rcon. If you need me to edit I will. Works like a charm!


Код:
if(strcmp(cmd, "/kick", true) == 0)
{
	new tmp[256];
	tmp = strtok(cmdtext, idx);

	if(!strlen(tmp)){
	SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Player ID]");
	return 1;
	}

  giveplayerid = strval(tmp);
	GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
	//GetPlayerName(playerid, sendername, sizeof(sendername));

	if(IsPlayerAdmin(playerid) == 1 || (L2M[playerid]==1) || (L3M[playerid]==1) ){
		if (IsPlayerAdmin(giveplayerid) == 0) {
		Kick(giveplayerid);
		format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
		SendClientMessageToAll(COLOR_WHITE,string);
		format(string, sizeof(string), "RADICAL RP ADMINISTRATIVE NOTICE");
		SendClientMessageToAll(COLOR_BRIGHTRED,string);
		format(string, sizeof(string), "%s has been kicked from the server.",giveplayername);
		SendClientMessageToAll(COLOR_BLUE,string);
		format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
		SendClientMessageToAll(COLOR_WHITE,string);
		printf("%s",string);
		}else{
		SendClientMessage(playerid, COLOR_RED, "Invalid player ID.");
		}
	}else{
	SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command.");
	}
return 1;
}



Re: /kick id [Reason] - juuleman - 21.02.2010

Thanks but im getting these errors:
Код:
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\gamemodes\Ec-rls.pwn(16785) : warning 219: local variable "tmp" shadows a variable at a preceding level
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\gamemodes\Ec-rls.pwn(16794) : error 017: undefined symbol "giveplayername"
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\gamemodes\Ec-rls.pwn(16794) : error 017: undefined symbol "giveplayername"
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\gamemodes\Ec-rls.pwn(16794) : error 029: invalid expression, assumed zero
P:\EastCoast Real Life ServeR\EastCoast Real Life ServeR\penls0.2\penls0.2\penls0.2\penls0.2\penls0.2\samp03asvr_win32\gamemodes\Ec-rls.pwn(16794) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: /kick id [Reason] - Correlli - 21.02.2010

The best way for you is to use zcmd + sscanf.