How to convert this code?
#1

Hello SA-MP Users. My Doubt is:

I need an Admin Chat CMD like /a [Text]. Also a Vip chat with /v [Text]

Well, actually, my GM uses "#" for Admin Chat, and "*" For Vip Chat;

Here the Codes :
Код:
//==============================================================================
// Vip Chat
//==============================================================================
	if(text[0] == '*' && AccInfo[playerid][pVip] >= 1)
	{
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
		MessageToPlayerVIP(0xDC686BAA,string);
		SaveIn("ChatVipLog",string);
	    return 0;
	}
//==============================================================================
// Administration Chat
//==============================================================================
	if(text[0] == '#' && AccInfo[playerid][Level] >= 1)
	{
	    new string[128]; GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
		MessageToAdmins(green,string);
		GetPlayerName(playerid,string,sizeof(string));
		format(string,sizeof(string),"9Admin Chat: %s: %s",string,text[1]);
		IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
		#if ADM_CHAT_LOG == true
		SaveIn("AdmChatLog",string);
		#endif
	    return 0;
	}
I disliked that, so i would appreciate to someone's help to convert those codes.

Thanks.
Reply
#2

Convert to what? DCMD, OCMD, ZCMD, strcmp?
Reply
#3

Please put the codes in the bracket
Reply
#4

pawn Код:
CMD:v(playerid,params[])
{
new string[128],text[124]; GetPlayerName(playerid,string,sizeof(string));
if(sscanf(params,"s[124]",text)) return SendClientMessage(playerid,-1,"USAGE: /v [text]");
format(string,sizeof(string),"|ChatVip| %s: %s",string,text);
MessageToPlayerVIP(0xDC686BAA,string);
SaveIn("ChatVipLog",string);
return 1;
}


CMD:a(playerid,params[])
{
new string[128],text[124]; GetPlayerName(playerid,string,sizeof(string));
if(sscanf(params,"s[124]",text)) return SendClientMessage(playerid,-1,"USAGE: /a [text]");
format(string,sizeof(string),"Admin Chat: %s: %s",string,text);
MessageToAdmins(green,string);
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"9Admin Chat: %s: %s",string,text);
IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
#if ADM_CHAT_LOG == true
SaveIn("AdmChatLog",string);
#endif
return 0;
}
Reply
#5

Download ZCMD and:

pawn Код:
CMD:v(playerid, params[])
{
    if(AccInfo[playerid][pVip] >= 1)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
        MessageToPlayerVIP(0xDC686BAA,string);
        SaveIn("ChatVipLog",string);
        return 1;
    }
}
pawn Код:
CMD:a(playerid, params[])
{
    if(AccInfo[playerid][Level] >= 1)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
        MessageToAdmins(green,string);
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"9Admin Chat: %s: %s",string,text[1]);
        IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdmChatLog",string);
        #endif
        return 1;
    }
}
Reply
#6

Thank you Guys!! Now its Working Great!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)