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

Just for the fun of it i made it a lil bit faster and named it scmd for "Super Command"!!!!!!!!



Enjoy,

KEEP ME IN CREDITS!!!!! xDDDDDD

pawn Код:
#include <a_samp>//Credits to SA-MP Developers!
#include <sscanf2>//Credits to whoever made this!

#define scmd(%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 call_scmd(%1) format(params,sizeof(params),""%1" %s",params),CallLocalFunction("OnPlayerCommandText","ds",playerid,params)

public OnPlayerCommandText(playerid, cmdtext[])
{
    new params[128];
    scmd("/say")//A simple /say command :D
    {
        new getplayerid, msg, pName[24], string[128];
        if(sscanf(params, "d", msg)) return SendClientMessage(playerid,0x0,"USAGE: /say [msg]");
        GetPlayerName(getplayerid, pName, sizeof(pName));
        format(string,sizeof(string),"* %s [%d] Says: %s",pName,getplayerid,msg);
        SendClientMessageToAll(0x0,string);
        return true;
    }
    else scmd("/msg") return call_scmd("/say");//Also /msg will show /say :O!
   
    scmd("/help")//A simple /help command :D
    {
        SendClientMessageToAll(0x0,"Help Messages..");
        return true;
    }
    else scmd("/info") return call_scmd("/help");//Also /info will show /help :O!
   
    scmd("/ban")//A simple /ban command :D
    {
        new getplayerid, bName[24], str[128], Reason[64];
        if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0x0,"Your Not An Admin!");
        if(sscanf(params, "Ud",getplayerid, Reason)) return SendClientMessage(playerid,0x0,"USAGE: /ban [id] [reason]");
        GetPlayerName(getplayerid, bName, sizeof(bName));
        format(str,sizeof(str),"%s [%d] Has Been Banned! [Reason: %s]",bName, getplayerid, Reason);
        SendClientMessageToAll(0x0,str);
        BanEx(getplayerid,str);
        return true;
    }
    return false;
}
//No more str-crap :D
((ZCMD FTW!))
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: 3 Guest(s)