Help with reading commands
#1

I am trying to get this to work,its from ladmin i want to know how it works so i am testing it on fresh script but it doesn't works,i want to know about the message thing,the messagetoadmins forward works but not cmd one


Код:
CMD:announce(playerid,params[])
{
    if(PInfo[playerid][Level] < 4)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 4 to announce.");
    new string[128],pText[64];
    if(sscanf(params,"s[128]",pText))
    return SendClientMessage(playerid,STEALTH_BLUE,"USAGE: /announce [text]");
    format(string,sizeof(string),"%s",pText);
    GameTextForAll(string,3000,3);
    CMDMessageToAdmins(playerid,"ANNOUNCE");
    return 1;
}

forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1) if (PInfo[i][Level] >= 1) SendClientMessage(i, color, string);
	}
	return 1;
}

stock CMDMessageToAdmins(playerid,command[])
{
	if(ServerInfo[AdminCmdMsg] == 0) return 1;
	new string[128]; GetPlayerName(playerid,string,sizeof(string));
	format(string,sizeof(string),"[ADMIN] %s has used the command %s",string,command);
	return MessageToAdmins(COLOR_INFOTEXT,string);
}
Reply
#2

try this
pawn Код:
stock CMDMessageToAdmins(playerid,command[])
{
new string[200],name[30];
GetPlayerName(playerid,name,30);
format(string,200,"[Admin]: %s has used the command %s",name,command);
return MessageToAdmins(color,string); }
Reply
#3

Thanks mate,works like a charm.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)