[Include] [MACROS] ycmd, easy & usefull cmd system
#1

What It?
It Easy cmd system, Vety usefull for filterscrits where you cant use strtok function
How To Use It?
Very Easy!
Examples:
Command /me [text]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new params[128];
	ycmd("/me")
	{
	    if(!strlen(params))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /me [text]");
	    new string[256];
	    format(string,sizeof(string),"** %s [ID: %d] %s",PlayerName(playerid),playerid,params);
	    SendClientMessageToAll(COLOR_MAIN,string);
	    return true;
	}
	return false;
}
Command /ban [playerid] [reason]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new params[128];
    ycmd("/ban")
    {
        if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOR_MAIN,"You Not Admin");
        if(!strlen(params))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /ban [playerid] [reason]");
        new idx, BannedID = strval(strtok(params,idx)),MessString[256],ReasonString[64];
        if(!strlen(params[idx]))ReasonString = "N/A";else format(ReasonString,sizeof(ReasonString),"%s",params[idx]);
        format(MessString,sizeof(MessString),"Admin %s [ID:%d] Ban %s [ID:%d] [Reason: %s]",PlayerName(playerid),playerid,PlayerName(BannedID),BannedID,ReasonString);
        SendClientMessageToAll(COLOR_MAIN,MessString);
        BanEx(BannedID,MessString);
	return true;
   }
   return false;
}
Command /pm | msg [playerid] [text]
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new params[128];
	ycmd("/pm")
	{
            new idx, tmp[256], id, string[256];
            tmp = strtok(params,idx);
	    if(!strlen(tmp))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /pm | msg [playerid] [text]");
	    id = strval(tmp);
	    tmp = strtok(params,idx);
	    if(!strlen(tmp))return SendClientMessage(playerid,COLOR_MAIN,"USAGE: /pm | msg [playerid] [text]");
	    format(string,sizeof(string),"* PM From %s [ID: %d] To %s [ID: %d]",PlayerName(playerid),playerid,PlayerName(id),id,tmp);
	    SendClientMessage(playerid,COLOR_MAIN,string);
	    SendClientMessage(id,COLOR_MAIN,string);
	    return true;
	}
	ycmd("/msg")return ycmd_red("/pm");
	
	return false;
}
cmd Speed
Sory But Speed is not Fantastic...

Where Get This Macroses?
Here!
Код:
#define ycmd(%1) if(!strcmp(cmdtext,%1,true,strlen(%1))&&((!strlen(cmdtext[strlen(%1)])&&format(params,sizeof(params),""))||(cmdtext[strlen(%1)]==' '&&format(params,sizeof(params),"%s",cmdtext[strlen(%1)+1]))))
#define ycmd_red(%1) format(params,sizeof(params),""%1" %s",params),CallLocalFunction("OnPlayerCommandText","ds",playerid,params)
You Have Any Examle Script?
Yeh!
There Pastebin Click

Comment Please!!!
Sory For bad english
Reply


Messages In This Thread
[MACROS] ycmd, easy & usefull cmd system - by YmOn - 06.07.2010, 00:14
Re: [MACROS] ycmd, easy & usefull cmd system - by iZN - 06.07.2010, 05:55
Re: [MACROS] ycmd, easy & usefull cmd system - by nuriel8833 - 06.07.2010, 06:23
Re: [MACROS] ycmd, easy & usefull cmd system - by Masj - 06.07.2010, 06:44
Re: [MACROS] ycmd, easy & usefull cmd system - by YmOn - 06.07.2010, 07:43
Re: [MACROS] ycmd, easy & usefull cmd system - by CaHbKo - 06.07.2010, 07:50
Re: [MACROS] ycmd, easy & usefull cmd system - by YmOn - 06.07.2010, 09:10
Re: [MACROS] ycmd, easy & usefull cmd system - by SlashPT - 06.07.2010, 11:07
Re: [MACROS] ycmd, easy & usefull cmd system - by Calgon - 06.07.2010, 16:05
Re: [MACROS] ycmd, easy & usefull cmd system - by Jantjuh - 06.07.2010, 21:20
Re: [MACROS] ycmd, easy & usefull cmd system - by YmOn - 06.07.2010, 23:31
Re: [MACROS] ycmd, easy & usefull cmd system - by Sergei - 07.07.2010, 00:08
Re: [MACROS] ycmd, easy & usefull cmd system - by Toni - 07.07.2010, 00:29
Re: [MACROS] ycmd, easy & usefull cmd system - by Calgon - 07.07.2010, 00:32
Re: [MACROS] ycmd, easy & usefull cmd system - by YmOn - 07.07.2010, 02:31
Re: [MACROS] ycmd, easy & usefull cmd system - by Toni - 07.07.2010, 02:52
Re: [MACROS] ycmd, easy & usefull cmd system - by Lorenc_ - 07.07.2010, 02:57
Re: [MACROS] ycmd, easy & usefull cmd system - by Romanius - 07.07.2010, 09:27
Re: [MACROS] ycmd, easy & usefull cmd system - by MaTrIx4057 - 07.07.2010, 09:38
Re: [MACROS] ycmd, easy & usefull cmd system - by Orhun_Dakilir - 07.07.2010, 09:39
Re: [MACROS] ycmd, easy & usefull cmd system - by Lorenc_ - 08.07.2010, 02:21
Re: [MACROS] ycmd, easy & usefull cmd system - by FreshKilla - 08.07.2010, 02:32
Re: [MACROS] ycmd, easy & usefull cmd system - by YmOn - 12.07.2010, 00:53
Re: [MACROS] ycmd, easy & usefull cmd system - by Romanius - 12.07.2010, 06:58
Re: [MACROS] ycmd, easy & usefull cmd system - by Brian_Furious - 27.10.2010, 11:36
Re: [MACROS] ycmd, easy & usefull cmd system - by eXtr1kE - 27.10.2010, 12:07
Re: [MACROS] ycmd, easy & usefull cmd system - by Zh3r0 - 27.10.2010, 18:52
Re: [MACROS] ycmd, easy & usefull cmd system - by The_Moddler - 27.10.2010, 19:04
Re: [MACROS] ycmd, easy & usefull cmd system - by Scenario - 27.10.2010, 19:18
Re: [MACROS] ycmd, easy & usefull cmd system - by YungGee - 17.02.2011, 14:36
Re: [MACROS] ycmd, easy & usefull cmd system - by Misha_Konsta - 18.02.2011, 15:51
Re: [MACROS] ycmd, easy & usefull cmd system - by digman - 09.11.2011, 22:08
Re: [MACROS] ycmd, easy & usefull cmd system - by filipyoyo - 10.11.2011, 11:20
Re: [MACROS] ycmd, easy & usefull cmd system - by GAMER_PS2 - 13.11.2011, 08:12
Respuesta: Re: [MACROS] ycmd, easy & usefull cmd system - by digman - 15.11.2011, 13:30

Forum Jump:


Users browsing this thread: 1 Guest(s)