if(!strcmp(cmdtext, "/me", true, 3)) { new find = strfind(cmdtext," ",true); if(find == -1 || find >= 30) return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/me\" [text]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext[find+1]); ProxDetector(170.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); return 0; }
if(strcmp(cmd, "/me", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]");
return 1;
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
format(string, sizeof(string), "* Stranger %s", result);
}
else
{
format(string, sizeof(string), "* %s %s", sendername, result);
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
}
return 1;
}
if(!strcmp(cmdtext, "/me", true, 3)) { new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "* %s %s", str, cmdtext); ProxDetector(170.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); return 0; }
if(!strcmp(cmdtext, "/me", true, 3) && cmdtext[3] <= ' ')
{
new find = 3;
while(cmdtext[find] == ' ') find++;
if(!cmdtext[find]) return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/me\" [text]");
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "* %s %s", str, cmdtext[find]);
ProxDetector(170.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
// Top line
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
// Code
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))
{
if(!BigEar[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(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col1, string);
}
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col2, string);
}
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col3, string);
}
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col4, string);
}
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
SendClientMessage(i, col5, string);
}
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}//not connected
return 1;
}
Hi, i'm having the same problem and I tried Anzhelov's Code and I got "Server.pwn(12 : error 017: undefined symbol "ProxDetector"". If someone could help me with ProxDetector I woule be grateful
|
CMD:me(playerid, params[])
{
new Reasons[128],str[128],Name[MAX_PLAYER_NAME];
if(sscanf(params,"s", Reasons)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [Text]");
GetPlayerName(playerid,Name, sizeof(Name));
format(str, sizeof(str), "* %s %s", Name, Reasons);
SendClientMessageToAll(0xFF9900AA, str);
return 1;
}
//if(!strcmp(cmdtext,"/g ",true,3)) // { // new find = strfind(cmdtext,"/g ",true, 2); // if(find == -1 || find >= 30) return SendClientMessage(playerid, COLOR_GREY, "Usage: /g [text]"); // new string[256]; //bite me // GetPlayerName(playerid,string,sizeof(string)); // format(string,sizeof(string),"((Global: %s: %s ))", string, cmdtext[find+1]); // return SendClientMessageToAll(COLOR_SEAGREEN, string); // }
#define Red 0xFF0000FF #define Grey 0xAFAFAFAA #define Green 0x33AA33AA #define Yellow 0xFFFF00AA #define White 0xFFFFFFAA #define Blue 0x0000BBAA #define Lightblue 0x33CCFFAA #define Orange 0xFF9900AA #define Lime 0x10F441AA #define Magenta 0xFF00FFFFT #define Navy 0x000080AA #define Aqua 0xF0F8FFAA #define Crimson 0xDC143CAA #define Black 0x000000AA #define Brown 0XA52A2AAA #define Gold 0xB8860BAA #define Limegreen 0x32CD32AA
#include <a_samp> #define Red 0xFF0000FF #define Grey 0xAFAFAFAA #define Green 0x33AA33AA #define Yellow 0xFFFF00AA #define White 0xFFFFFFAA #define Blue 0x0000BBAA #define Lightblue 0x33CCFFAA #define Orange 0xFF9900AA #define Lime 0x10F441AA #define Magenta 0xFF00FFFFT #define Navy 0x000080AA #define Aqua 0xF0F8FFAA #define Crimson 0xDC143CAA #define Black 0x000000AA #define Brown 0XA52A2AAA #define Gold 0xB8860BAA #define Limegreen 0x32CD32AA
if(!strcmp(cmdtext, "/g", true, 3)) { if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /g [text]"); new str[128]; GetPlayerName(playerid, str, sizeof(str)); format(str, sizeof(str), "%s %s", str, cmdtext[4]); SendClientMessageToAll(COLOR_LIMEGREEN, str); return 1; }