SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 07/04/2012, 12:29 PM   #1
Youice
Huge Clucker
 
Youice's Avatar
 
Join Date: Jan 2012
Location: Earth Reputation:9999
Posts: 421
Reputation: 27
Default some RP commands

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!

Last edited by Youice; 20/06/2012 at 08:55 PM.
Youice is offline   Reply With Quote
Old 07/04/2012, 12:35 PM   #2
Vukilore
High-roller
 
Vukilore's Avatar
 
Join Date: Jan 2011
Posts: 3,060
Reputation: 96
Default Re : some RP commands

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

Logic
__________________
It's not about changing the world, it's about leaving the world the way it means to be..
Vukilore is offline   Reply With Quote
Old 07/04/2012, 05:57 PM   #3
Emil123
Big Clucker
 
Join Date: Mar 2012
Posts: 103
Reputation: 1
Default Re: some RP commands

cool good work youce
Emil123 is offline   Reply With Quote
Old 07/04/2012, 06:20 PM   #4
The__
Huge Clucker
 
Join Date: Nov 2011
Posts: 451
Reputation: 53
Default Re: Re : some RP commands

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);
}
__________________
The__ is offline   Reply With Quote
Old 07/04/2012, 06:52 PM   #5
organe.
Little Clucker
 
organe.'s Avatar
 
Join Date: Apr 2012
Posts: 37
Reputation: 0
Default Re: some RP commands

thnaks for script Youice. I use in my server.
organe. is offline   Reply With Quote
Old 16/04/2012, 06:37 PM   #6
Youice
Huge Clucker
 
Youice's Avatar
 
Join Date: Jan 2012
Location: Earth Reputation:9999
Posts: 421
Reputation: 27
Default Re: Re : some RP commands

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!
Youice is offline   Reply With Quote
Old 16/04/2012, 06:43 PM   #7
iNorton
High-roller
 
iNorton's Avatar
 
Join Date: Oct 2011
Location: United Kingdom
Posts: 1,193
Reputation: 236
Default Re: some RP commands

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.
iNorton is online now   Reply With Quote
Old 16/04/2012, 07:28 PM   #8
Youice
Huge Clucker
 
Youice's Avatar
 
Join Date: Jan 2012
Location: Earth Reputation:9999
Posts: 421
Reputation: 27
Default Re: some RP commands

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.....
Youice is offline   Reply With Quote
Old 20/06/2012, 05:49 AM   #9
Dare Devil.....
Huge Clucker
 
Dare Devil.....'s Avatar
 
Join Date: Jan 2012
Location: Pakistan
Posts: 255
Reputation: 10
Default Re: some RP commands

He I am not able to get this in to my game mode can you tell me where should I put what thing?
Dare Devil..... is offline   Reply With Quote
Old 20/06/2012, 08:53 PM   #10
Youice
Huge Clucker
 
Youice's Avatar
 
Join Date: Jan 2012
Location: Earth Reputation:9999
Posts: 421
Reputation: 27
Default Re: some RP commands

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) ^^
Youice is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Login/Register using ZCMD SSCANF & Y_INI.( Admin commands + VIP System + VIP Commands! ) Zh3r0 Filterscripts 115 03/06/2013 06:30 AM
Help, no commands will work except for admin commands? MrPlayboy Help Archive 1 05/08/2011 12:07 AM
Transforming zcmd's commands to regular commands nuriel8833 Help Archive 17 08/01/2011 06:41 AM
DCMD Commands not working after adding some ZCMD commands :S [L3th4l] Help Archive 4 20/01/2010 10:57 PM


All times are GMT. The time now is 08:18 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.