Global Chat Help?
#6

PHP код:
public OnPlayerText(playeridtext[])
{
    
// Anti Adv
    
if(AntiAdv(playeridtext)) return 0;
    
// The Rest
    
new string[128];
    
/*format(ircMsg, sizeof(ircMsg), "02[%d] 07%s: %s", playerid, RPN(playerid), text);
    IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg); */
    
if(Mobile[playerid] != INVALID_PLAYER_ID)
    {
        
format(stringsizeof(string), "(Cellphone) %s says: %s"RPN(playerid), text);
        if(
IsPlayerInAnyVehicle(playerid)) { //Windows closed.
            
format(stringsizeof(string), "%s"string);
            
SendNearbyMessage(playerid3.0string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        } else {
            
SendNearbyMessage(playerid3.0string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
        }

        if(
Mobile[playerid] == 914)
        {
            if(!
text[0])
            {
                
SendClientMessage(playeridTEAM_CYAN_COLOR"Dispatch: Sorry, I don't understand?");
                return 
0;
            }
            
SendClientMessage(playeridTEAM_CYAN_COLOR"Dispatch: We have alerted all units in the area.");
            
SendClientMessage(playeridTEAM_CYAN_COLOR"Thank you for reporting this incident");

            
format(stringsizeof(string), "Dispatch: All Units IA: Caller: %s",RPN(playerid));
            
SendLSFMDMessage(COLOR_TWPINKstring);
            
format(stringsizeof(string), "Dispatch: Incident: %s",text);
            
SendLSFMDMessage(COLOR_TWPINKstring);
            foreach(
Playeri)
            {
                if(
IsPlayerInRangeOfPoint(i100.01498.6595,-2182.5081,14.1682) || IsPlayerInRangeOfPoint(i25.02408.0505,-1330.7889,879.7735))
                {
                       
PlayAudioStreamForPlayer(i"http://vc-rp.eu/firetone.mp3");
                    
format(stringsizeof(string), "* The fire alarm tone rings out as a call comes in *");
                    
SendClientMessage(iACTIONstring);
                }
            }
            
CalledMedics[playerid] = 1;
            
MedicsCallTime[playerid] = 60;
            
ShowPlayerBeaconForMedics(playerid);
            
SendClientMessage(playeridCOLOR_WHITE"   They hung up...");
            
Mobile[playerid] = INVALID_PLAYER_ID;

            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
            
RemovePlayerAttachedObject(playerid9);
            return 
0;
        }
        if(
Mobile[playerid] == 913)
        {
            if(!
text[0])
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: Sorry, I don't understand?");
                return 
0;
            }
            if(
strcmp("no"texttrue) == 0)
            {
                
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: We have alerted all units in the area.");
                
SendClientMessage(playeridCOLOR_DBLUE"Thank you for reporting this crime.");
                
format(stringsizeof(string), "HQ: All Units APB: Reporter: %s",RPN(playerid));
                
SendFBIMessage(COLOR_DBLUEstring);
                
SendCopMessage(COLOR_DBLUEstring);
                
format(stringsizeof(string), "HQ: Crime: %s, Suspect: Unknown",PlayerCrime[playerid][pAccusing]);
                
SendFBIMessage(COLOR_DBLUEstring);
                
SendCopMessage(COLOR_DBLUEstring);
                
CalledCops[playerid] = 1;
                
CopsCallTime[playerid] = 60;
                
ShowPlayerBeaconForCops(playerid);
                
SendClientMessage(playeridCOLOR_WHITE"   They hung up...");
                
Mobile[playerid] = INVALID_PLAYER_ID;

                
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                
RemovePlayerAttachedObject(playerid9);
                return 
0;
            }
            new 
badguy playerid;
            if(
IsPlayerConnected(badguy))
            {
                if(
badguy != INVALID_PLAYER_ID)
                {
                    if(
PlayerInfo[badguy][pCrimes] > 0)
                    {
                        
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: Units are already assigned to that case...");
                        
SendClientMessage(playeridCOLOR_DBLUE"Thank you for reporting this crime.");
                        
SendClientMessage(playeridCOLOR_WHITE"   They hung up...");
                        
Mobile[playerid] = INVALID_PLAYER_ID;
                        return 
0;
                    }
                    if(
badguy == playerid)
                    {
                        
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: Don't fool around. This is an emergency line.");
                        
SendClientMessage(playeridCOLOR_WHITE"   They hung up...");
                        
Mobile[playerid] = INVALID_PLAYER_ID;
                        return 
0;
                    }
                    
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: We have alerted all units in the area.");
                    
SendClientMessage(playeridCOLOR_DBLUE"Thank you for reporting this crime.");

                    
format(stringsizeof(string), "HQ: All Units APB: Reporter: %s",RPN(playerid));
                    
SendFBIMessage(COLOR_DBLUEstring);
                    
SendCopMessage(COLOR_DBLUEstring);
                    
format(stringsizeof(string), "HQ: Crime: %s, Suspect: %s",PlayerCrime[playerid][pAccusing], RPN(badguy));
                    
SendFBIMessage(COLOR_DBLUEstring);
                    
SendCopMessage(COLOR_DBLUEstring);
                    
CalledCops[playerid] = 1;
                    
CopsCallTime[playerid] = 60;
                    
ShowPlayerBeaconForCops(playerid);
                    
SendClientMessage(playeridCOLOR_WHITE"   They hung up...");
                    
Mobile[playerid] = INVALID_PLAYER_ID;

                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                    
RemovePlayerAttachedObject(playerid9);
                    return 
0;
                }
                return 
0;
            }
            else
            {
                
format(stringsizeof(string), "Police HQ: I have no information on %s, are you sure that's the correct name?",text);
                
SendClientMessage(playeridCOLOR_DBLUEstring);
                return 
0;
            }
        }
        if(
Mobile[playerid] == 912)
        {
            if(!
text[0])
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: Sorry, I don't understand?");
                return 
0;
            }
            
strmid(PlayerCrime[playerid][pAccusing], text0strlen(text), 255);
            
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: If you know the assailant's name or part of it say it now or just say no.");
            
Mobile[playerid] = 913;
            return 
0;
        }
        if(
Mobile[playerid] == 911)
        {
            if(!
text[0])
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: Sorry, I don't understand - police or paramedic?");
                return 
0;
            }
            else if(
strcmp("police"texttrue) == 0)
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: I am patching you to police headquarters, please hold...");
                
Mobile[playerid] = 912;
                
SendClientMessage(playeridCOLOR_DBLUE"Police HQ: Please give me a short description of the crime.");
                return 
0;
            }
            else if(
strcmp("paramedic"texttrue) == 0)
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: I am patching you to Medical Emergency Services headquarters, please hold...");
                
Mobile[playerid] = 914;
                
SendClientMessage(playeridTEAM_CYAN_COLOR"Dispatch: Please give me a short description of the incident.");
                return 
0;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCY: Sorry, I don't understand - police or paramedic?");
                return 
0;
            }
        }
        if(
IsPlayerConnected(Mobile[playerid]))
        {
            if(
Mobile[Mobile[playerid]] == playerid)
            {
                if(
SpeakerPhone[playerid] != 0)
                {
                    
format(stringsizeof(string), "(speakerphone) %s says: %s"RPN(playerid), text);
                    
SendNearbyMessage(Mobile[playerid], 3.0string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                }
                else
                {
                    
SendClientMessage(Mobile[playerid], COLOR_YELLOWstring);
                }
                if(
PlayerInfo[playerid][pBugged] == 1)
                {
                    
format(stringsizeof(string), "(bug) %s (cellphone): %s"RPN(playerid), text);
                    
SendAdminMessage(COLOR_LIGHTGREEN1string);
                }
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"There's nobody there!");
            
CellTime[playerid] = 0;
            
SendClientMessage(playerid,  COLOR_WHITE"   You hung up.");
            
Mobile[playerid] = INVALID_PLAYER_ID;
            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
            
RemovePlayerAttachedObject(playerid9);
        }
        return 
0;
    }
    else if(
Live[playerid])
    {
        if(
IsNewsVehicle(GetPlayerVehicleID(playerid)))
        {
            
format(stringsizeof(string), "** [Live News]: %s: %s"RPN(playerid), text);
            
SendClientMessageToAll(COLOR_LIGHTGREENstring);
            
/*format(ircMsg, sizeof(ircMsg), "3[Live News] %s(%d): %s", RPN(playerid), playerid, text);
            IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg); */
        
}
    }
    else
    {
        new 
str[256], playername[MAX_PLAYER_NAME];
        
GetPlayerName(playeridplayernamesizeof(playername));
        
format(strsizeof(str), "%s{FF0000}[%d]: {FFFFFF}%s"playernameplayeridtext);
        
SendClientMessageToAll(DEFAULT_YELLOWstr);
    }
    
SendNearbyMessage(playerid10stringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
    
Log("logs/chat.log"string);
    return 
0;

Reply


Messages In This Thread
Global Chat Help? - by Tass007 - 28.04.2016, 10:12
Re: Global Chat Help? - by BloodyRP - 28.04.2016, 10:21
Re: Global Chat Help? - by oMa37 - 28.04.2016, 10:22
Re: Global Chat Help? - by Tass007 - 07.05.2016, 03:40
Re: Global Chat Help? - by Sew_Sumi - 07.05.2016, 04:46
Re: Global Chat Help? - by Tass007 - 07.05.2016, 07:58
Re: Global Chat Help? - by jlalt - 07.05.2016, 08:03
Re: Global Chat Help? - by Dayrion - 07.05.2016, 11:17
Re: Global Chat Help? - by PrO.GameR - 07.05.2016, 12:27
Re: Global Chat Help? - by Sew_Sumi - 07.05.2016, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)