How to be an admin on my server ????
#28

Quote:
Originally Posted by [BG]DOOM
Посмотреть сообщение
Raptor admin script ..Actually i can kick and ban from console but not from game like /kick or /ban and how i can make someone admin ?
kick/kick [id] [reason])
Код:
COMMAND:kick(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
	new id,reason[64];
	if(sscanf(params,"i",id)) return SendClientMessage(playerid,color_red,"USAGE: /kick [id] [reason]");
    sscanf(params,"is[64]",id,reason);
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color_red,"Player not connected.");
	if(!strlen(reason))
	{
	    SendClientMessageToAllEx(color_blue,"sssss","***Administrator ",PlayerInfo[playerid][Username],"{FFFFFF} kicked ",PlayerInfo[id][Username],".");
	} else {
	    SendClientMessageToAllEx(color_blue,"sssssss","***Administrator ",PlayerInfo[playerid][Username],"{FFFFFF} kicked ",PlayerInfo[id][Username]," Reason:",reason,".");
	}
	return Kick(id);
}
ban/ban [id] [reason])
Код:
COMMAND:ban(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
	new id,reason[64];
	if(sscanf(params,"i",id)) return SendClientMessage(playerid,color_red,"USAGE: /ban [id] [reason]");
    sscanf(params,"is[64]",id,reason);
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color_red,"Player not connected.");
	if(!strlen(reason))
	{
	    SendClientMessageToAllEx(color_blue,"sssss","***Administrator ",PlayerInfo[playerid][Username],"{FFFFFF} banned ",PlayerInfo[id][Username],".");
	} else {
	    SendClientMessageToAllEx(color_blue,"sssssss","***Administrator ",PlayerInfo[playerid][Username],"{FFFFFF} banned ",PlayerInfo[id][Username]," Reason:",reason,".");
	}
	return Ban(id);
}
setlevel/setlevel [id] [reason])
Код:
COMMAND:setlevel(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 3&& !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
	new id,level;if(sscanf(params,"ii",id,level)) return SendClientMessage(playerid,color_red,"USAGE: /setlevel [playerid] [level 0/3]");
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color_red,"Player not connected.");
	if(level > 3) return SendClientMessage(playerid,color_red,"Error! You can only pick between level 0/3 (0: Player - 1: Moderator - 2: Administrator - 3: Owner)");
	if(PlayerInfo[id][Level] < level)
	{
		PlayerInfo[id][Level] = level;
		SendClientMessageEx(playerid,color_green,"sssis","You have promoted ",PlayerInfo[id][Username]," succesfully to level ",level,".");
		SendClientMessageEx(id,color_green,"sis","Congratulations! You have been promoted to level ",level,".");
	} else {
		PlayerInfo[id][Level] = level;
		SendClientMessageEx(playerid,color_green,"sssis","You have demoted ",PlayerInfo[id][Username]," succesfully to level ",level,".");
		SendClientMessageEx(id,color_green,"sis","You have been demoted to level ",level,".");
	}
	SaveUser(id);
	return 1;
}
dont forget to put this on:
Код:
#include <zcmd>
here
have fun!
(if u will get any error,let me know...)
Reply


Messages In This Thread
How to be an admin on my server ???? - by [BG]DOOM - 03.03.2011, 14:52
Re: How to be an admin on my server ???? - by wheelman_WM - 03.03.2011, 14:54
Re: How to be an admin on my server ???? - by [BG]DOOM - 03.03.2011, 16:15
Re: How to be an admin on my server ???? - by -Monkey - 03.03.2011, 16:31
Re: How to be an admin on my server ???? - by [BG]DOOM - 03.03.2011, 17:04
Re: How to be an admin on my server ???? - by grand.Theft.Otto - 03.03.2011, 21:38
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 05:39
Re: How to be an admin on my server ???? - by alpha500delta - 04.03.2011, 06:50
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 07:39
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 09:17
Re: How to be an admin on my server ???? - by BASITJALIL - 04.03.2011, 09:19
Re: How to be an admin on my server ???? - by bhaveshnande - 04.03.2011, 09:32
Re: How to be an admin on my server ???? - by BASITJALIL - 04.03.2011, 09:37
Re: How to be an admin on my server ???? - by alpha500delta - 04.03.2011, 12:39
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 13:07
Re: How to be an admin on my server ???? - by BASITJALIL - 04.03.2011, 13:15
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 13:25
Re: How to be an admin on my server ???? - by BASITJALIL - 04.03.2011, 13:46
Re: How to be an admin on my server ???? - by [BG]DOOM - 04.03.2011, 15:33
Re: How to be an admin on my server ???? - by BASITJALIL - 04.03.2011, 17:10
Re: How to be an admin on my server ???? - by aceisnice - 04.03.2011, 19:02
Re: How to be an admin on my server ???? - by zach121212 - 19.03.2011, 23:43
Re: How to be an admin on my server ???? - by alpha500delta - 20.03.2011, 09:29
Re: How to be an admin on my server ???? - by [SFA]SpiRRiT - 20.03.2011, 09:33
Re: How to be an admin on my server ???? - by [SFA]SpiRRiT - 20.03.2011, 10:05
Re: How to be an admin on my server ???? - by Dark_Thunder - 22.03.2011, 09:18
Re: How to be an admin on my server ???? - by alpha500delta - 22.03.2011, 12:12
Re: How to be an admin on my server ???? - by [ProX]BlueFire - 25.03.2011, 09:24

Forum Jump:


Users browsing this thread: 1 Guest(s)