Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerText(playerid, text[]) {
- #if defined DEBUG
- printf("[debug] OnPlayerText(%d, %s)", playerid, text);
- #endif
- if(playerVariables[playerid][pStatus] >= 1 && playerVariables[playerid][pMuted] == 0) {
- new
- queryString[255],
- iRetStr = strfind(text, "(", true, 0),
- textString[128];
- GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
- for(new i = 0; i < strlen(szPlayerName); i++) {
- if (szPlayerName[i] == '_') szPlayerName[i] = ' ';
- }
- if(iRetStr < 4 && iRetStr != -1 && playerVariables[playerid][pAdminDuty] == 0) {
- format(textString, sizeof(textString), "(( %s dice: %s ))", szPlayerName, text);
- nearByMessage(playerid, COLOR_ICE, textString);
- }
- if(playerVariables[playerid][pPhoneCall] != -1) {
- format(textString, sizeof(textString), "(Cellulare) \"%s\"", text);
- if(!strcmp(playerVariables[playerid][pAccent], "none", true))
- format(textString, sizeof(textString), "(Cellulare) %s dice: %s", szPlayerName, text);
- else
- format(textString, sizeof(textString), "(Cellulare) (Accento %s) %s dice: %s", playerVariables[playerid][pAccent], szPlayerName, text);
- nearByMessage(playerid, COLOR_WHITE, textString);
- switch (playerVariables[playerid][pPhoneCall]) {
- case 455: {
- if(strlen(text) > 1) {
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- SendToJob(3, COLOR_BROWN,"|___________S.O.S. Reporting___________|");
- format(textString, sizeof(textString), "Soggetto: %s - Telefono: %d", szPlayerName, playerVariables[playerid][pPhoneNumber]);
- SendToJob(3, COLOR_BROWN, textString);
- format(textString, sizeof(textString), "Luogo: %s%", location);
- SendToJob(3, COLOR_BROWN, textString);
- format(textString, sizeof(textString), "Descrizione: %s%", text);
- SendToJob(3, COLOR_BROWN, textString);
- SendClientMessage(playerid, COLOR_AZZURRO, "Centralino: D'accordo, il primo meccanico disponibile la contatterà o la raggiungerà direttamente.");
- SendClientMessage(playerid, COLOR_AZZURRO, "L'operatore ha riagganciato.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- }
- playerVariables[playerid][pPhoneCall] = -1;
- }
- }
- case 555: {
- if(strlen(text) > 1) {
- new location[MAX_ZONE_NAME];
- if(jobVariables[playerid][jJobDuty] == 1)
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- SendToJob(5, COLOR_ORANGE,"|___________Nuova Esigenza___________|");
- format(textString, sizeof(textString), "Soggetto: %s - Telefono: %d", szPlayerName, playerVariables[playerid][pPhoneNumber]);
- SendToJob(5, COLOR_ORANGE, textString);
- format(textString, sizeof(textString), "Luogo: %s%", location);
- SendToJob(5, COLOR_ORANGE, textString);
- format(textString, sizeof(textString), "Descrizione: %s%", text);
- SendToJob(5, COLOR_ORANGE, textString);
- SendClientMessage(playerid, COLOR_AZZURRO, "Centralino: D'accordo, un tassista la contatterà quanto prima.");
- SendClientMessage(playerid, COLOR_AZZURRO, "L'operatore ha riagganciato.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- }
- playerVariables[playerid][pPhoneCall] = -1;
- }
- }
- case 911: {
- if(strlen(text) > 1) {
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- SendToGroup(1, COLOR_AZZURRO,"|___________Chiamata 911___________|");
- format(textString, sizeof(textString), "Soggetto: %s - Telefono: %d", szPlayerName, playerVariables[playerid][pPhoneNumber]);
- SendToGroup(1, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Luogo: %s%", location);
- SendToGroup(1, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Situazione: %s%", text);
- SendToGroup(1, COLOR_AZZURRO, textString);
- SendClientMessage(playerid, COLOR_AZZURRO, "Centralino 911: D'accordo, stia calmo e rimanga al sicuro, sono state avvisate le pattuglie.");
- SendClientMessage(playerid, COLOR_AZZURRO, "L'operatore ha riagganciato.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- }
- playerVariables[playerid][pPhoneCall] = -1;
- }
- }
- case 118: {
- if(strlen(text) > 1) {
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- SendToGroup(2, COLOR_AZZURRO,"|___________Chiamata 118___________|");
- format(textString, sizeof(textString), "Soggetto: %s - Telefono: %d", szPlayerName, playerVariables[playerid][pPhoneNumber]);
- SendToGroup(2, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Luogo: %s%", location);
- SendToGroup(2, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Situazione: %s%", text);
- SendToGroup(2, COLOR_AZZURRO, textString);
- SendClientMessage(playerid, COLOR_AZZURRO, "Centralino 911: D'accordo, stia calmo e tenga duro, sono state avvisate le pattuglie.");
- SendClientMessage(playerid, COLOR_AZZURRO, "L'operatore ha riagganciato.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- }
- playerVariables[playerid][pPhoneCall] = -1;
- }
- }
- case 115: {
- if(strlen(text) > 1) {
- new location[MAX_ZONE_NAME];
- GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
- SendToGroup(5, COLOR_AZZURRO,"|___________Chiamata 115___________|");
- format(textString, sizeof(textString), "Soggetto: %s - Telefono: %d", szPlayerName, playerVariables[playerid][pPhoneNumber]);
- SendToGroup(5, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Luogo: %s%", location);
- SendToGroup(5, COLOR_AZZURRO, textString);
- format(textString, sizeof(textString), "Situazione: %s%", text);
- SendToGroup(5, COLOR_AZZURRO, textString);
- SendClientMessage(playerid, COLOR_AZZURRO, "Centralino 911: D'accordo, stia calmo e si tenga al sicuro, manderemo qualcuno immediatamente.");
- SendClientMessage(playerid, COLOR_AZZURRO, "L'operatore ha riagganciato.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- }
- playerVariables[playerid][pPhoneCall] = -1;
- }
- else SendClientMessage(playerid, COLOR_CELESTE, "(Cellulare) 911: Scusi, non ho ben capito. Può ripetere per favore?");
- }
- default: { // If they're calling a player, this code is executed.
- SendClientMessage(playerVariables[playerid][pPhoneCall], COLOR_GREY, textString);
- mysql_real_escape_string(textString, textString);
- format(queryString, sizeof(queryString), "INSERT INTO chatlogs (value, playerinternalid) VALUES('%s', '%d')", textString, playerVariables[playerid][pInternalID]);
- mysql_query(queryString);
- }
- }
- }
- else {
- if(!strcmp(playerVariables[playerid][pAccent], "None", true))
- format(textString, sizeof(textString), "{FFFFFF}%s dice: %s", szPlayerName, text);
- else
- format(textString, sizeof(textString), "(Accento %s) {FFFFFF}%s dice: %s", playerVariables[playerid][pAccent], szPlayerName, text);
- if(playerVariables[playerid][pAdminDuty] >= 1) format(textString, sizeof(textString), "(( %s dice: %s ))", szPlayerName, text);
- nearByMessage(playerid, COLOR_ICE, textString);
- mysql_real_escape_string(textString, textString);
- format(queryString, sizeof(queryString), "INSERT INTO chatlogs (value, playerinternalid) VALUES('%s', '%d')", textString, playerVariables[playerid][pInternalID]);
- mysql_query(queryString);
- format(textString, sizeof(textString), "\"%s\"", text);
- }
- playerVariables[playerid][pSpamCount]++;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment