[FilterScript] Simple Commands By Mr.Kakashi
#1

Simple Commands By Mr.Kakashi


Hi Another Cool Script From Me its a simple commands that i use on my server
Some of them are not Heres the list that inside the filterscript

Me Command
/kill
/afk
/back
/help
/parachute
/lol

I hope you love it

Heres The Download Link:

Mediafire:

http://www.mediafire.com/?6x8m64zn21ets1e

Pastebin:

http://www.pastebin.com/VQB9mmGd

I hope you gonna use it
Reply
#2

Very Very simple......
Reply
#3

Quote:
Originally Posted by Horrible
Посмотреть сообщение
Very Very simple......
is it cool?
Reply
#4

Quote:
Originally Posted by lyrics
Посмотреть сообщение
is it cool?
I dont think so...
but will be better added more CMD and make some system...
Reply
#5

Quote:
Originally Posted by Horrible
Посмотреть сообщение
I dont think so...
but will be better added more CMD and make some system...
I will later, i was busy setting my gamemode
Reply
#6

That's too easy for a person that calls himself a scripter that's the 'best' whilst posting one line of code into a thread.
Reply
#7

Quote:
Originally Posted by Horrible
Посмотреть сообщение
I dont think so...
but will be better added more CMD and make some system...
Your name describes this, Horrible.


- Multiple ways of defining cmdtext. Copied commands?
- Horrible indentation.
- Shitton of colors even if you don't really need them.
- 100 Parachute? What do you do with that?
- /help is 10 characters long?
- /kill is 10 characters long?
- /lol is 10 characters long?
- Did you even <test> these commands?
- Did you even <make> some of them?
- 'And Be Right Back' => 'And Will Be Right Back'
- Why are you using strcmp? I understand you're a beginner, but even so, zcmd is so much faster and easier. (although y_commands is my personal favourite, people are going to argue)
- What on Earth is this?!

Your original code:
pawn Код:
//      Simple Commands By Mr.Kakashi
//         Script By Mr.Kakashi
//          Copyright 2011
//         Great for Beginners
//
 
//Dont Remove Credits!
 
#include <a_samp>
 
//Define Colors
 
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xFF0000FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
 
#if defined FILTERSCRIPT
 
public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" Simple Commands By Mr.Kakashi");
        print("--------------------------------------\n");
        return 1;
}
 
public OnFilterScriptExit()
{
        return 1;
}
 
#else
#endif
 
public OnPlayerCommandText(playerid, cmdtext[])
{
        if(strcmp("/lol", cmdtext, true, 10) == 0)
    {
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have to be in a vehicle");
        {
        RemovePlayerFromVehicle(playerid);
                SetVehicleHealth(vehicleid, 4.0);
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_RED, "OWNED!, Your Vehicle Has Been Destroy, You Have Been LOL Pranked");
                }
                return 1;
    }
 
        if(strcmp("/parachute", cmdtext, true, 10) == 0)
        {
                GivePlayerWeapon(playerid, 46,100);
                SendClientMessage(playerid,COLOR_GREEN,"Enjoy with Your Parachute!");
                return 1;
        }
 
        if(strcmp("/help", cmdtext, true, 10) == 0)
        {
                SendClientMessage(playerid,COLOR_WHITE,"Your Information Here!");
                return 1;
        }
 
    if(strcmp(cmdtext, "/afk", true) == 0)
    {
                new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"You Are Now AFK");
        SendClientMessage(playerid, COLOR_WHITE,"Type /back when you are back to play");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FAF623}%s is now AFK And Be Right Back",pName);
        SendClientMessageToAll(COLOR_YELLOW, string);
        TogglePlayerControllable(playerid, 0);
        SetPlayerHealth(playerid, 999999.999);
                return 1;
    }
 
    if(strcmp(cmdtext, "/back", true) == 0)
    {
                new pName[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"Welcome Back");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s is back and able to play again",pName);
        SendClientMessageToAll(COLOR_RED, string);
        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, 100);
                return 1;
    }
 
        if(!strcmp(cmdtext, "/me", true, 3))
    {
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "%s %s", str, cmdtext[4]);
        SendClientMessageToAll(COLOR_YELLOW, str);
                return 1;
    }
   
    if(strcmp("/kill", cmdtext, true, 10) == 0)
        {
                SetPlayerHealth(playerid, 0);
        return 1;
        }
        return 0;
}


Modified with everything I said fixed:
pawn Код:
//      Simple Commands By Mr.Kakashi
//         Script By Mr.Kakashi
//          Copyright 2011
//         Great for Beginners
//

    #include <a_samp>
   
    #define COLOR_RED 0xFF0000FF
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_WHITE 0xFFFFFFAA

    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print(" Simple Commands By Mr.Kakashi");
            print("--------------------------------------\n");
            return 1;
    }
   
    public OnPlayerCommandText(playerid, cmdtext[])
    {
            if(strcmp("/lol", cmdtext, true, 4) == 0)
            {
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid,COLOR_RED,"ERROR: You have to be in a vehicle.");
                }
                else
                {
                    RemovePlayerFromVehicle(playerid);
                    SetVehicleHealth(vehicleid, 4.0); // Why 4.0? Why SetVehicleHealth? Why not EXPLODE the goddamn thing? Meh, your choice.
                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_RED, "OWNED! Your vehicle has been destroyed, you have been LOL pranked!");
                }
                return 1;
            }

            if(strcmp("/parachute", cmdtext, true, 10) == 0)
            {
                GivePlayerWeapon(playerid, 46, 1);
                SendClientMessage(playerid,COLOR_GREEN,"SERVER: Enjoy your parachute!");
                return 1;
            }

            if(strcmp("/help", cmdtext, true, 5) == 0)
            {
                SendClientMessage(playerid,COLOR_WHITE,"Your information goes here.");
                return 1;
            }

            if(strcmp(cmdtext, "/afk", true) == 0)
            {
                new pName[MAX_PLAYER_NAME];
                new string[128+MAX_PLAYER_NAME]; // Remember to include MAX_PLAYER_NAME in strings like the such
                GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"You are now AFK.");
                SendClientMessage(playerid, COLOR_WHITE,"Type /back when you are back to play");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FAF623}%s is now AFK And Will Be Right Back",pName);
                SendClientMessageToAll(COLOR_WHITE, string);
                TogglePlayerControllable(playerid, 0);
                SetPlayerHealth(playerid, 999999.999);
                return 1;
            }

            if(strcmp(cmdtext, "/back", true) == 0)
            {
                new pName[MAX_PLAYER_NAME];
                new string[128+MAX_PLAYER_NAME];
                GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"Welcome back!");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s is back and able to play again",pName);
                SendClientMessageToAll(COLOR_RED, string);
                TogglePlayerControllable(playerid, 1);
                SetPlayerHealth(playerid, 100);
                return 1;
            }

            if(!strcmp(cmdtext, "/me", true, 3))
            {
                new str[128];
                GetPlayerName(playerid, str, sizeof(str));
                format(str, sizeof(str), "%s %s", str, cmdtext[4]);
                SendClientMessageToAll(COLOR_WHITE, str);
                return 1;
            }

            if(strcmp("/kill", cmdtext, true, 5) == 0)
            {
                SetPlayerHealth(playerid, 0);
                return 1;
            }
            return 0;
    }

Modified with ZCMD (one of the fastest command processors, very easy to use):

pawn Код:
//      Simple Commands By Mr.Kakashi
//         Script By Mr.Kakashi
//          Copyright 2011
//         Great for Beginners
//

    #include <a_samp>
    #include <zcmd>
   
    #define COLOR_RED 0xFF0000FF
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_WHITE 0xFFFFFFAA

    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print(" Simple Commands By Mr.Kakashi");
            print("--------------------------------------\n");
            return 1;
    }

    public OnPlayerCommandText(playerid, cmdtext[])
    {
            return SendClientMessage(playerid, -1, "SERVER: Unknown command!"); // You can change this. :)
    }
            // HELP
           
            CMD:help(playerid, params[])
            {
                #pragma unused params
                SendClientMessage(playerid,COLOR_WHITE,"Your information goes here.");
                return 1;
            }


            // AFK SYSTEM
           
            CMD:afk(playerid, params[])
            {
                #pragma unused params
                new pName[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"You are now AFK.");
                SendClientMessage(playerid, COLOR_WHITE,"Type /back when you are back to play");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FAF623}%s is now AFK And Will Be Right Back",pName);
                SendClientMessageToAll(COLOR_WHITE, string);
                TogglePlayerControllable(playerid, 0);
                SetPlayerHealth(playerid, 999999.999);
                return 1;
            }

            CMD:back(playerid, params[])
            {
                #pragma unused params
                new pName[MAX_PLAYER_NAME];
                new string[128];
                GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                SendClientMessage(playerid, COLOR_WHITE,"Welcome back!");
                format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s is back and able to play again",pName);
                SendClientMessageToAll(COLOR_RED, string);
                TogglePlayerControllable(playerid, 1);
                SetPlayerHealth(playerid, 100);
                return 1;
            }


            // /ME
           
            CMD:me(playerid, params[])
            {
                #pragma unused params
                new str[128];
                GetPlayerName(playerid, str, sizeof (str));
                format(str, sizeof (str), ""#COL_YELLOW"* %s "#COL_ORANGE"%s", str, params);
                SendClientMessageToAll(0xFF0000AA, str);
                return 1;
            }

            // SUICIDE COMMAND
           
            CMD:kill(playerid, params[])
            {
                #pragma unused params
                SetPlayerHealth(playerid, 0);
                return 1;
            }
           
            // FUNNY COMMANDS
           
            CMD:lol(playerid, params[])
            {
                #pragma unused params
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid,COLOR_RED,"ERROR: You have to be in a vehicle.");
                }
                else
                {
                    RemovePlayerFromVehicle(playerid);
                    SetVehicleHealth(vehicleid, 4.0); // Why 4.0? Why SetVehicleHealth? Why not EXPLODE the goddamn thing? Meh, your choice.
                    PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                    SendClientMessage(playerid, COLOR_RED, "OWNED! Your vehicle has been destroyed, you have been LOL pranked!");
                }
                return 1;
            }

            // PARACHUTE
           
            CMD:parachute(playerid, params[])
            {
                #pragma unused params
                GivePlayerWeapon(playerid, 46, 1);
                SendClientMessage(playerid,COLOR_GREEN,"SERVER: Enjoy your parachute!");
                return 1;
            }
What you call 'code for beginners' is nothing than a mess. Sorry to say.

If you would try to have better indentation and use y_commands' marvelous features, like this, I think people would like your work more.


pawn Код:
//      Simple Commands By Mr.Kakashi
//         Script By Mr.Kakashi
//          Copyright 2011
//         Great for Beginners
//

    #include <a_samp>
    #include <YSI/y_commands>
    #include <YSI/y_colors>

    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print(" Simple Commands By Mr.Kakashi");
            print("--------------------------------------\n");
            Command_AddAltNamed("help", "commands");
            Command_AddAltNamed("parachute", "para");
            Command_AddAltNamed("lol", "rofl");
            Command_AddAltNamed("afk", "brb");
            Command_AddAltNamed("kill", "suicide");
            return 1;
    }

    public OnPlayerCommandText(playerid, cmdtext[])
    {
            return SendClientMessage(playerid, -1, "SERVER: Unknown command!"); // You can change this. :)
    }
            // HELP
           
            CMD:help(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /help command shows a list of all the 'main'");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"server commands.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    if (isnull(params))
                    {
                        SendClientMessage(playerid,COLOR_WHITE,"Your information goes here.");
                        SendClientMessage(playerid,COLOR_WHITE,"Use /help [command] to see more information about each command.");
                    }
                    else
                    {
                        Command_ReProcess(playerid, params, true);
                    }
                }
                return 1;
            }


            // AFK SYSTEM
           
            CMD:afk(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /afk command freezes you and protects you");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"while you are away from keyboard.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    new pName[MAX_PLAYER_NAME];
                    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                    SendClientMessage(playerid, COLOR_WHITE,"You are now AFK.");
                    SendClientMessage(playerid, COLOR_WHITE,"Type /back when you are back to play");
                    format(string, sizeof(string), "{FFFFFF}[SERVER]:{FAF623}%s is now AFK And Will Be Right Back",pName);
                    SendClientMessageToAll(COLOR_WHITE, string);
                    TogglePlayerControllable(playerid, 0);
                    SetPlayerHealth(playerid, 999999.999);
                }
                return 1;
            }

            CMD:back(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /back command allows you to play again");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"after coming back.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    new pName[MAX_PLAYER_NAME];
                    new string[128];
                    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
                    SendClientMessage(playerid, COLOR_WHITE,"Welcome back!");
                    format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s is back and able to play again",pName);
                    SendClientMessageToAll(COLOR_RED, string);
                    TogglePlayerControllable(playerid, 1);
                    SetPlayerHealth(playerid, 100);
                }
                return 1;
            }


            // /ME
           
            CMD:me(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /me command is a clone of the /me command");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"from IRC.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    new str[128];
                    GetPlayerName(playerid, str, sizeof (str));
                    format(str, sizeof (str), ""#COL_YELLOW"* %s "#COL_ORANGE"%s", str, params);
                    SendClientMessageToAll(0xFF0000AA, str);
                }
                return 1;
            }

            // SUICIDE COMMAND
           
            CMD:kill(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /kill command allows you to kill yourself");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    SetPlayerHealth(playerid, 0);
                }
                return 1;
            }
           
            // FUNNY COMMANDS
           
            CMD:lol(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /lol command allows you to destroy your own vehicle.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    if(!IsPlayerInAnyVehicle(playerid))
                    {
                        SendClientMessage(playerid,COLOR_RED,"ERROR: You have to be in a vehicle.");
                    }
                    else
                    {
                        RemovePlayerFromVehicle(playerid);
                        SetVehicleHealth(vehicleid, 4.0); // Why 4.0? Why SetVehicleHealth? Why not EXPLODE the goddamn thing? Meh, your choice.
                        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_RED, "OWNED! Your vehicle has been destroyed, you have been LOL pranked!");
                    }
                }
                return 1;
            }

            // PARACHUTE
           
            CMD:parachute(playerid, params[])
            {
                #pragma unused params
                if (help)
                {
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"The /parachute command gives you a parachute.");
                    SendClientMessage(playerid, -1, ""#COL_BLUE"SERVER: "#COL_LIME"---------------------------------------------");
                }
                else
                {
                    GivePlayerWeapon(playerid, 46, 1);
                    SendClientMessage(playerid,COLOR_GREEN,"SERVER: Enjoy your parachute!");
                }
                return 1;
            }
Reply
#8

totally useless fs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)