[FilterScript] some RP commands
#1

Hello!

I know that a lot of people will disagree with this post cause its nub...

I have posted this due to I saw a lot of people asking for RP commands like /me /do /s /l and so on...

Okay here is the code of them::

Code:
//==============================================================================
CMD:me(playerid, params[])// By YOUICE
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}

	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
	new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s %s", name, params);
	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}
//==============================================================================
CMD:do(playerid, params[])// By YOUICE
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}

	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /do [action]");
	new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s ((%s))", params, name);
	ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	return 1;
}
//==============================================================================
CMD:shout(playerid, params[]) {// By YOUICE
	return cmd_s(playerid, params);
}
//==============================================================================
CMD:s(playerid, params[])// By YOUICE
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}

	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/s)hout [shout chat]");
	new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "(shouts) %s!", params);
	SetPlayerChatBubble(playerid,string,COLOR_WHITE,60.0,5000);
	format(string, sizeof(string), "%s shouts: %s!", name, params);
	ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
	return 1;
}
//==============================================================================
CMD:low(playerid, params[]) {// By YOUICE
	return cmd_l(playerid, params);
}
//==============================================================================
CMD:l(playerid, params[])// By YOUICE
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}

	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/l)ow [close chat]");

	new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s says quietly: %s", name, params);
	ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	format(string, sizeof(string), "(quietly) %s", params);
	SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
	return 1;
}
//==============================================================================
CMD:b(playerid, params[])// By YOUICE
{
	if(gPlayerLogged{playerid} == 0)
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
		return 1;
	}
	if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
	new string[128];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s: (( %s ))", name, params);
	ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
	return 1;
}
//==============================================================================
Add this any where in the script! I prefer at at the bottom..

Code:
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
//==============================================================================
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
            {
                GetPlayerPos(i, posx, posy, posz);
                tempposx = (oldposx -posx);
                tempposy = (oldposy -posy);
                tempposz = (oldposz -posz);
                if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // If the player is within 16 meters
                {
                    SendClientMessage(i, col1, string);
                }
                else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
                {
                    SendClientMessage(i, col2, string);
                }
                else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
                {
                    SendClientMessage(i, col3, string);
                }
                else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
                {
                    SendClientMessage(i, col4, string);
                }
                else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
                {
                    SendClientMessage(i, col5, string);
                }
            }
            else
            {
                SendClientMessage(i, col1, string);
            }
        }
    }
    return 1;
}
//==============================================================================
I hope that I have helped every one needs it!
Reply
#2

pawn Code:
CMD:shout(playerid, params[]) {// By YOUICE
    return cmd_shout(playerid, params);
}
Logic
Reply
#3

cool good work youce
Reply
#4

Quote:
Originally Posted by Vukilore
View Post
pawn Code:
CMD:shout(playerid, params[]) {// By YOUICE
    return cmd_shout(playerid, params);
}
Logic
Needs to be.
pawn Code:
CMD:shout(playerid, params[]) {// By YOUICE
    return cmd_s(playerid, params);
}
Reply
#5

thnaks for script Youice. I use in my server.
Reply
#6

Quote:
Originally Posted by Emil123
View Post
cool good work youce
Thank you bro ; )

Quote:
Originally Posted by organe.
View Post
thnaks for script Youice. I use in my server.
Np bro : D

Quote:
Originally Posted by The__
View Post
Needs to be.
pawn Code:
CMD:shout(playerid, params[]) {// By YOUICE
    return cmd_s(playerid, params);
}
added thank you!
Reply
#7

Very easy to make not sure why it is as filterscript since if people asked for these commands so much you could do a tutorial how to make them.

But meh good job.
Reply
#8

Quote:
Originally Posted by iNorton
View Post
Very easy to make not sure why it is as filterscript since if people asked for these commands so much you could do a tutorial how to make them.

But meh good job.
If I made a tutorial maybe some people will say what is the use of it if there a lot of tutorials about commands so I decided to make those and post them... any way "meh" thanks.....
Reply
#9

He I am not able to get this in to my game mode can you tell me where should I put what thing?
Reply
#10

First of all, you must download zcmd.inc (credits to zeex),
after put the zcmd.inc file in pawno > includes,
after open your GM put under " #include <a_samp> " (put) "#include <zcmd>"
then follow my steps in the thread (up) ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)