29.08.2011, 22:13
I wanna make a command for FBI like /listenphone [name/id] and that command listen his phone..
I tried but it doesn't works
Код:
if(Mobile[playerid] != 255) { new idx; tmp = strtok(text, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s Says (cellphone): %s", sendername, text); ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5); //printf("callers line %d called %d caller %d",Mobile[Mobile[playerid]],Mobile[playerid],playerid); if(Mobile[playerid] == 914) { if(!strlen(tmp)) { SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: Sorry I don't understand?"); return 0; } new turner[MAX_PLAYER_NAME]; new wanted[128]; GetPlayerName(playerid, turner, sizeof(turner)); SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: We have alerted all units in the area."); SendClientMessage(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this incident"); format(wanted, sizeof(wanted), "Dispatch: All Units IA: Caller: %s",turner); SendTeamBeepMessage(1, TEAM_CYAN_COLOR, wanted); format(wanted, sizeof(wanted), "Dispatch: Incident: %s",text); SendTeamMessage(1, TEAM_CYAN_COLOR, wanted); SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; } if(Mobile[playerid] == 913) { if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i dont understand?"); return 0; } if ((strcmp("no", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("no"))) { new turner[MAX_PLAYER_NAME]; new wanted[128]; GetPlayerName(playerid, turner, sizeof(turner)); SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: We have alerted all units in the area."); SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime"); format(wanted, sizeof(wanted), "HQ: All Units APB: Reporter: %s",turner); SendFamilyMessage(1, COLOR_DBLUE, wanted); format(wanted, sizeof(wanted), "HQ: Crime: %s, Suspect: Unknown",PlayerCrime[playerid][pAccusing]); SendFamilyMessage(1, COLOR_DBLUE, wanted); SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; } new badguy; //badguy = strval(tmp); badguy = ReturnUser(tmp); if (IsPlayerConnected(badguy)) { if(badguy != INVALID_PLAYER_ID) { if (gTeam[badguy] == 2 || gTeam[badguy] == 1) { SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: You will have to contact internal affairs. This is an emergency line"); SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; } if (WantedPoints[badguy] > 0) { SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Units are already assigned to that case"); SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime"); SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; } if (badguy == playerid) { SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Dont Fool Around, This is an emergency line."); SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; } SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: We have alerted all units in the area."); SendClientMessage(playerid, COLOR_DBLUE, "Thank you for reporting this crime"); SetPlayerCriminal(badguy,playerid, PlayerCrime[playerid][pAccusing]); if(WantedPoints[badguy] > 0) { } else { WantedPoints[badguy] += 2; } SendClientMessage(playerid, COLOR_GRAD2, " They Hung Up..."); Mobile[playerid] = 255; return 0; }//invalid id return 0; }//not connected else { format(string, sizeof(string), "Police HQ: I have no Information on %s, are you sure thats the right name?",tmp); SendClientMessage(playerid, COLOR_DBLUE, string); return 0; } } if(Mobile[playerid] == 912) { if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i dont understand?"); return 0; } strmid(PlayerCrime[playerid][pAccusing], text, 0, strlen(text), 255); SendClientMessage(playerid, COLOR_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(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i dont understand, police or paramedic?"); return 0; } else if ((strcmp("police", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("police"))) { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: I am patching you to Police HQ, please hold."); Mobile[playerid] = 912; SendClientMessage(playerid, COLOR_DBLUE, "Police HQ: Please give me a short description of the crime."); return 0; } else if ((strcmp("paramedic", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("paramedic"))) { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: I am patching you to Paramedic HQ, please hold."); Mobile[playerid] = 914; SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: Please give me a short description of the Incident."); return 0; } else { SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i dont understand, police or paramedic?"); return 0; } } if(IsPlayerConnected(Mobile[playerid])) { if(Mobile[Mobile[playerid]] == playerid) { SendClientMessage(Mobile[playerid], COLOR_YELLOW,string); } } else { SendClientMessage(playerid, COLOR_YELLOW,"Theres nobody there"); } return 0; }