SA-MP Forums Archive
[FilterScript] some RP commands - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] some RP commands (/showthread.php?tid=332167)



some RP commands - Youice - 07.04.2012

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!


Re : some RP commands - Vukilore - 07.04.2012

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


Re: some RP commands - Emil123 - 07.04.2012

cool good work youce


Re: Re : some RP commands - The__ - 07.04.2012

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



Re: some RP commands - organe. - 07.04.2012

thnaks for script Youice. I use in my server.


Re: Re : some RP commands - Youice - 16.04.2012

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!


Re: some RP commands - iNorton - 16.04.2012

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.


Re: some RP commands - Youice - 16.04.2012

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.....


Re: some RP commands - Dare Devil..... - 20.06.2012

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


Re: some RP commands - Youice - 20.06.2012

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) ^^