/kick id [Reason]
#1

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
Reply
#2

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

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

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.
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)