SA-MP Forums Archive
[Help] /kick command [Please] - 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: [Help] /kick command [Please] (/showthread.php?tid=141419)



[Help] /kick command [Please] - Thrarod - 13.04.2010

I want a command that if you have 100 or more score you can kick a player, you dont have to be an admin

/kick [ID] only, no reason, and if player has more than 100 score, kick [ID] param and take 100 score from player

Thanks if you help


Re: [Help] /kick command [Please] - Torran - 13.04.2010

Wow really?
Wouldnt like to be on your server,

Anyway.. Theres a filterscript that comes with Server Package called base,
There is a /kick command in there, Just edit the admin check to score check


Re: [Help] /kick command [Please] - Thrarod - 13.04.2010

It cant get abused because for one kick you have to kill about 25 people


Re: [Help] /kick command [Please] - Killer32 - 13.04.2010

On top after includes:
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
OnPlayerCommandText:
Код:
dcmd(kick,4,cmdtext);
At the end of script:
Код:
dcmd_kick(playerid,params[]) {
	if (strlen(params))
	{
	  new id;
		id = strval(params);
		if (GetPlayerScore(playerid) > 99) {
			new PScore = GetPlayerScore(playerid);
		  Kick(id);
		  SendClientMessage(playerid,0xE60000FF,"The player have been kicked!");
			SetPlayerScore(playerid,PScore - 100);
		} else {
		  SendClientMessage(playerid,0xE60000FF,"You don't have enough score to use this command!");
		}
		return 1;
	}
	return SendClientMessage(playerid,ZALIA,"You forgot the player ID!");
}



Re: [Help] /kick command [Please] - Thrarod - 14.04.2010

I already did, and I needed strcmp


Re: [Help] /kick command [Please] - Killer32 - 15.04.2010

strcmp slows your server down i think