Two HQs with the same interior (chat problem)
#1

Hi, i have two Faction HQs with the same interior but different virtual world.
The problem is on the chat. For example, the first HQ is School Instructors and the second is Taxi Company
The members of school instructors can see what the members of taxi company are talking in the HQ
How to fix this? Look at my /enter cmds:
Код:
if(strcmp(cmdtext, "/enter", true) == 0)
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
	   {
		 if PlayerToPoint(5,playerid,-2447.0032,523.1661,30.3037)
		 *then
		 {
		   SetPlayerPos(playerid,1494.325195,1304.942871,1093.289062);
		   SetPlayerInterior(playerid,3);
		   SetPlayerVirtualWorld(playerid, 77);
		   SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to School Instructors HQ !");
		   return 1;
		 }
		}
	}
and
Код:
if(strcmp(cmdtext, "/enter", true) == 0)
    {
    if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10)
	   {
		 if PlayerToPoint(5,playerid,-1969.5778,92.0575,27.6875)
		 *then
		 {
		   SetPlayerPos(playerid,1494.325195,1304.942871,1093.289062);
		   SetPlayerInterior(playerid,3);
		   SetPlayerVirtualWorld(playerid, 79);
		   SendClientMessage(playerid,COLOR_1GREEN,"*** Welcome to Taxi Company HQ !");
		   return 1;
		 }
		}
	}
Reply
#2

In the radius chat, add virtual world checks (make sure they're in the same)
Reply
#3

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
In the radius chat, add virtual world checks (make sure they're in the same)
Can you please show me how to do it?I'm curently making a house system and also need this.
Thank you in advance.
Reply
#4

I dont understand... Can you give me an example?
Reply
#5

BUMP
Reply
#6

Somewhere in your chat function, you have a "radius check"

Something like
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,x,y,z))SendClientMessage(...);
What you need is to add an additional check of virtual world...
pawn Код:
if(GetPlayerVirtualWorld(playerid)==GetPlayerVirtualWorld(i))
    if(IsPlayerInRangeOfPoint(playerid,x,y,z))SendClientMessage(...);
Reply
#7

I dont see anything like this
Код:
if(strcmp(cmd, "/local", true) == 0 || strcmp(cmd, "/l", true) == 0 || strcmp(cmd, "/say", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				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: (/l)ocal [local chat]");
				return 1;
			}
			if(FindIP(result)) /// Anti-Reclama
   			{
				SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");
				new advertiser[MAX_PLAYER_NAME];
				GetPlayerName(playerid, advertiser, sizeof(advertiser));
				format(string, sizeof(string), "Server Guardian: {FFFF00}%s was kicked with reason: Write an IP Adreess (Reclama)",advertiser);
				SendClientMessageToAll(COLOR_RED,string);
				KickLog(string);
				Kick(playerid);
				return 1;
			}
			if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
			{
            new advertiser[MAX_PLAYER_NAME];
			GetPlayerName(playerid, advertiser, sizeof(advertiser));
			format(string, sizeof(string), "Server Guardian: {FFFF00}%s was kicked with reason: Reclama pe /l",advertiser);
			SendClientMessageToAll(COLOR_RED,string);
			Kick(playerid);
			return 0;
			}
			if(PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)
			    {
				    for(new i=0; i<MAX_ENTRY; i++)
					{
				 	    if(!Swear[i][0]) continue;
						Cenzura(result,Swear[i]);
					}
				}
			format(string, sizeof(string), "%s Says: %s", sendername, result);
			ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			printf("%s", string);


			if (PlayerInfo[playerid][pAdmin] >= 1339)
			{
			format(string, sizeof(string), "%s Says: %s", sendername, result);
			ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
			printf("%s", string);
            }


		}

		return 1;
	}
Reply
#8

It's inside 'ProxDetector' which btw, is something like a 6 year old function.
Reply
#9

undefined symbol "i"
Reply
#10

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)