Recieve chat only in the same VW
#1

How can I make it possible that if the players are in the same VW they can see each others chat but if they aren't they can't because I got this problem that if the VW is different they can't see each other but they can see the chat.
pawn Код:
//Under OnPlayerText
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname, '_', ' ');
    format(str, sizeof(str), "%s says: %s", pname, text);
    ProxDetector2(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 0;
Reply
#2

use the for loop and check if the player is in that virtual world, if yes. send the message to him
Reply
#3

Actually it's really tricky for me, because I use alot of VW's for my server, can I make something like this
pawn Код:
foreach(new i : Player)
    {
    if(PlayerInfo[i][pVW] == PlayerInfo[playerid][pVW])
    {
        GetPlayerPos(i, oPositionX[0], oPositionX[1], oPositionX[2]);
        if(IsPlayerInRangeOfPoint(i, radi / 16, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col1, string); }
        else if(IsPlayerInRangeOfPoint(i, radi / 8, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col2, string); }
        else if(IsPlayerInRangeOfPoint(i, radi / 4, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col3, string); }
        else if(IsPlayerInRangeOfPoint(i, radi / 2, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col4, string); }
        else if(IsPlayerInRangeOfPoint(i, radi, pPositionX[0], pPositionX[1], pPositionX[2])) { SendClientMessage(i, col5, string); }
        }
This under my ProxDetector2 function
Reply
#4

Try it. I myself have never used ProxDetector. I have heard of it but have never really shown interest in Roleplays.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)