07.04.2012, 12:29
(
Last edited by Youice; 20/06/2012 at 08:55 PM.
)
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::
Add this any where in the script! I prefer at at the bottom..
I hope that I have helped every one needs it!
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; } //==============================================================================
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; } //==============================================================================