SA-MP Forums Archive
How To Make A Commands - 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)
+--- Thread: How To Make A Commands (/showthread.php?tid=614541)



How To Make A Commands - CarRamper - 09.08.2016

How i Can Make A Command THrough Which i Can see Banned Players Name


Re: How To Make A Commands - Freaksken - 09.08.2016

When you ban a player, store his name in a file. When you unban the player, remove the name from the file.


Re: How To Make A Commands - CarRamper - 10.08.2016

Please Tell ME How Please How I Can Make A LoG That Add Players Name IF I Will Ban Then And Also Remove The Name Of That player For Log I I Unban Them
BAN CMD
Код:
CMD:ban(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 2) {
		    new tmp[256], tmp2[256], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE:{FFFFFF} /Ban [playerid] [reason]");
			if(!strlen(tmp2)) return SendClientMessage(playerid, red, "USAGE:{FFFFFF} /Ban [playerid] [reason]");
	    	new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);

		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
				GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
				new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
				CMDMessageToAdmins(playerid,"BAN");
				format(string,sizeof(string),"*** Player %s has been banned by Administrator %s.",playername,adminname);
				SendClientMessageToAll(red,string);
				format(string,sizeof(string),"[Reason: %s]",params[2]);
				SendClientMessageToAll(red,string);
                SaveToFile("BanLog",string);
				print(string);
                if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1);
				format(string,sizeof(string),"banned by Administrator %s. Reason: %s", adminname, params[2] );
				return BanEx(player1,params[2]);
			} else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
		} else return SendClientMessage(playerid,red,"ERROR:{FF9E00} You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR:{FF9E00} You must be logged in to use this commands");
}
And It Shows This In Log
Код:
[9.8.2016 10:43:45] [Reason: abuse]
 [9.8.2016 11:16:56] [Reason: abuse ]
But I Want That It Shows The NAme OF The Admin Who BAnned Him Reason And Name


Re: How To Make A Commands - CarRamper - 10.08.2016

Please Help ME


Re: How To Make A Commands - Shinja - 10.08.2016

You must create a ban system manually, not SA-MP's Ban and BanEx


Re: How To Make A Commands - Luicy. - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
You must create a ban system manually, not SA-MP's Ban and BanEx
False fact, once again get your information correct.
He can use Ban(..) and BanEx(..) if he want.


Re: How To Make A Commands - Shinja - 10.08.2016

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
False fact, once again get your information correct.
He can use Ban(..) and BanEx(..) if he want.
Then help him if you can. LMFAO


Re: How To Make A Commands - GhostHacker - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Then help him if you can. LMFAO
its not good habit that when someone finds an error in you and corrects it and you reply in such a -ve way and you should stop helping people as you are always guiding them to wrong place.

@op format the text with name and fwrite it to the file in which you are saving


Re: How To Make A Commands - Luicy. - 10.08.2016

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Then help him if you can. LMFAO
I'm not doing requests, he's not asking for help, he's making a request.


Re: How To Make A Commands - Shinja - 10.08.2016

Quote:
Originally Posted by GhostHacker
Посмотреть сообщение
its not good habit that when someone finds an error in you and corrects it and you reply in such a -ve way and you should stop helping people as you are always guiding them to wrong place.

@op format the text with name and fwrite it to the file in which you are saving
He found nothing... YOU MUST stop criticise something you don't know, last time you did with me you was wrong

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
I'm not doing requests, he's not asking for help, he's making a request.
Lel my love, you just can make criticism