Text only in vehicle?
#4

Okay but I'm working with OnPlayerText and vehicle windows (open/close) if windows are open we can see text if windows are closed - this supposed to be for vehicle message only (passengers and driver) but I can see my text and from a guy that is writing, but passengers can't see my text neither their own text, here is the code what I've made:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    new string[256];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i, vehicleid))
            {
                if(Carinfo[vehicleid][VehWin] == 0) // closed
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                    {
                        format(string, sizeof(string), "Driver %s: %s",Name,text);
                        SendClientMessage(i,-1,string);
                        return 0;
                    }
                    else
                    {
                        format(string, sizeof(string), "Passenger %s: %s",Name,text);
                        SendClientMessage(i,-1,string);
                        return 0;
                    }
                }
                if(Carinfo[vehicleid][VehWin] == 1) // opened
                {
                    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                    {
                        format(string, sizeof(string), "Driver %s: %s",Name,text);
                        ProxDetector(8.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE); // Radius need to be checked..
                        return 0;
                    }
                    else
                    {
                        format(string, sizeof(string), "Passenger %s: %s",Name,text);
                        ProxDetector(8.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE); // Radius need to be checked..
                        return 0;
                    }
                }
            }
        }
    }
    return 1;
}
So I want to make if windows are closed and players are talking inside of the car, only they will see text.. how to fix that?

Thanks for help in advance!
Reply


Messages In This Thread
Text only in vehicle? - by Lajko1 - 20.02.2014, 21:48
Re: Text only in vehicle? - by Flake. - 21.02.2014, 00:50
Re: Text only in vehicle? - by Aerotactics - 21.02.2014, 06:18
Re: Text only in vehicle? - by Lajko1 - 21.02.2014, 17:15
Re: Text only in vehicle? - by Lajko1 - 21.02.2014, 21:34
Re: Text only in vehicle? - by Dignity - 21.02.2014, 21:50
Re: Text only in vehicle? - by Scenario - 21.02.2014, 22:20
Re: Text only in vehicle? - by Threshold - 21.02.2014, 23:49
Re: Text only in vehicle? - by Lajko1 - 27.02.2014, 14:25
Re: Text only in vehicle? - by Threshold - 27.02.2014, 22:04

Forum Jump:


Users browsing this thread: 4 Guest(s)