SA-MP Forums Archive
Useful Commands #1 - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: Useful Commands #1 (/showthread.php?tid=95)

Pages: 1 2 3


Re: Post your Useful/Intresting/Weird OnPlayerCommandText Commands! - Nitroglycerine - 10.10.2006

Users over nr 19

Handy for a server where you have more than 20 userslots. It gives id 20-24 (our server has 25 userslots), if you have more than 30 slots you should make a /30 script since you can only have 10 lines of text in your chatwindow.
Code:
  if(strcmp(cmd, "/20", true) == 0 && IsAdmin(playerid) && adminlevel[playerid] > 0) {
		SendClientMessage(playerid, COLOR_ADMIN_GM, "Userlist of ID over 19:");
		//Manual adjusting when userslots are increased.
		for(new i=20;i<25;i++){
			if(IsPlayerConnected(i)){
				GetPlayerName(i, giveplayer, sizeof(giveplayer));
				format(string, sizeof(string), "* ID %d, Name %s", i,giveplayer);
				SendClientMessage(playerid, COLOR_ADMIN_GM, string);
			} else {
				format(string, sizeof(string), "* ID %d is not connected", i);
				SendClientMessage(playerid, COLOR_ADMIN_GM, string);
			}
		}
		return 1;
	}