SA-MP Forums Archive
How to convert this code? - 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 convert this code? (/showthread.php?tid=411793)



How to convert this code? - [WH]Marcos - 30.01.2013

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.


AW: How to convert this code? - Blackazur - 30.01.2013

Convert to what? DCMD, OCMD, ZCMD, strcmp?


Re: How to convert this code? - Madeline - 30.01.2013

Please put the codes in the bracket


Re: How to convert this code? - tyler12 - 30.01.2013

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;
}



Re: How to convert this code? - SKAzini - 30.01.2013

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;
    }
}



Re: How to convert this code? - [WH]Marcos - 30.01.2013

Thank you Guys!! Now its Working Great!