OnPlayerText - Car Windows
#1

Car Windows is bugged in onPlayerText its not correctly working.

When i say anything in IC chat its show the (Windows) message also.
So Let's Say
Johnny_Ashley says: test
(Windows) Johnny_Ashley says: test


pawn Код:
public OnPlayerText(playerid, text[])
{

  new string[128];
 
    if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0) {
   
    if(!IsPlayerInAnyVehicle(playerid)) {

    if(!PlayerUseMask(playerid))
       
       format(string, sizeof(string), "(Windows) %s says: %s", PlayerName(playerid), text);
    else
       format(string, sizeof(string), "(Windows)%d says: %s", MaskID[playerid], text);
           
    ProxDetector(10.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);

    }
   
    if (!PlayerUseMask(playerid))
   
        format(string, sizeof(string), "%s says: %s", PlayerName(playerid), text);
    else
        format(string, sizeof(string), "%d says: %s", MaskID[playerid], text);

    SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
   
    if(pcIncomingCall[playerid][pcAnswered] == 1)
    {
        new player = pcIncomingCall[playerid][pcCaller];
        if(player == playerid)
            player = pcIncomingCall[playerid][pcTarget];
           
        if(!PlayerUseMask(playerid))
           format(string, sizeof(string), "[PHONE] %s says: %s", PlayerName(playerid), text);
        else
           format(string, sizeof(string), "[PHONE]%d says: %s", MaskID[playerid], text);
        return 0;
        }
    }
    return 0;
}
Reply
#2

Use else if after your first if statement. In your current code, your server runs each if statement and checks whether or not they are true.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)