Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerText(playerid, text[])
- {
- format(LastText[playerid], strlen(text)+1, "%s", text);
- if(Mobile[playerid] != 255)
- {
- new string [128];
- new sendername[MAX_PLAYER_NAME];
- new idx;
- new tmp[MAX_PLAYER_NAME];
- 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);
- if(Mobile[playerid] == 920)
- {
- strmid(rrresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "EMERGENCY: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- Mobile[playerid] = 255;
- format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
- SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
- SendTeamBeepMessage(2, COLOR_DBLUE, string);
- format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
- SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
- SendTeamBeepMessage(2, COLOR_DBLUE, string);
- return 0;
- }
- if(Mobile[playerid] == 919)
- {
- strmid(rresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "EMERGENCY: Finally %s, what is your current location?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- Mobile[playerid] = 920;
- return 0;
- }
- if(Mobile[playerid] == 918)
- {
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand, what is your Name?");
- return 0;
- }
- else
- {
- strmid(reportername[playerid], tmp, 0, strlen(text), 255);
- format(string, sizeof(string), "EMERGENCY: Okay %s, what seems to be the problem?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- Mobile[playerid] = 919;
- return 0;
- }
- }
- if(Mobile[playerid] == 917)
- {
- strmid(rrresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "PARAMEDIC: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- Mobile[playerid] = 255;
- format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
- SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
- format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
- SendTeamBeepMessage(1, COLOR_ALLDEPT, string);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- return 0;
- }
- if(Mobile[playerid] == 916)
- {
- strmid(rresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "PARAMEDIC: Finally %s, what is your current location?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- Mobile[playerid] = 917;
- return 0;
- }
- if(Mobile[playerid] == 915)
- {
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ALLDEPT, "PARAMEDIC: Sorry i don't understand, what is your Name?");
- return 0;
- }
- else
- {
- strmid(reportername[playerid], tmp, 0, strlen(text), 255);
- format(string, sizeof(string), "PARAMEDIC: Okay %s, what seems to be the problem?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_ALLDEPT, string);
- Mobile[playerid] = 916;
- return 0;
- }
- }
- if(Mobile[playerid] == 914)
- {
- strmid(rrresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "POLICE: Thankyou %s, please stay calm, our units are on their way!", reportername[playerid]);
- SendClientMessage(playerid, COLOR_DBLUE, string);
- Mobile[playerid] = 255;
- format(string, sizeof(string), "HQ: Caller: %s. Location: %s",reportername[playerid], rrresult[playerid]);
- SendTeamBeepMessage(2, COLOR_DBLUE, string);
- format(string, sizeof(string), "HQ: Situation: %s",rresult[playerid]);
- SendTeamBeepMessage(2, COLOR_DBLUE, string);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
- return 0;
- }
- if(Mobile[playerid] == 913)
- {
- strmid(rresult[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "POLICE: Finally %s, what is your current location?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_DBLUE, string);
- Mobile[playerid] = 914;
- return 0;
- }
- if(Mobile[playerid] == 912)
- {
- strmid(reportername[playerid], text, 0, strlen(text), 255);
- format(string, sizeof(string), "POLICE: Okay %s, what seems to be the problem?", reportername[playerid]);
- SendClientMessage(playerid, COLOR_DBLUE, string);
- Mobile[playerid] = 913;
- return 0;
- }
- if(Mobile[playerid] == 911)
- {
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry I dont understand, police, paramedic or both?");
- return 0;
- }
- else if ((strcmp("police", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("police")))
- {
- Mobile[playerid] = 912;
- SendClientMessage(playerid, COLOR_DBLUE, "POLICE: Hello Sir/Madam, please give me your name.");
- return 0;
- }
- else if ((strcmp("paramedic", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("paramedic")))
- {
- Mobile[playerid] = 915;
- SendClientMessage(playerid, COLOR_ALLDEPT, "PARAMEDIC: Hello Sir/Madam, please give me your name.");
- return 0;
- }
- else if ((strcmp("both", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("both")))
- {
- Mobile[playerid] = 918;
- SendClientMessage(playerid, TEAM_CYAN_COLOR, "EMERGENCY: Hello Sir/Madam, please give me your name.");
- return 0;
- }
- else
- {
- SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry I dont understand, police, paramedic or both?");
- return 0;
- }
- }
- if(IsPlayerConnected(Mobile[playerid]) == 1 && Mobile[Mobile[playerid]] == playerid)
- {
- SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_YELLOW,"Theres nobody there");
- }
- return 0;
- }
- if (realchat)
- {
- if(accent[playerid] == 0)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 1)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Russian] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 2)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Italian] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 3)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Gangster] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 4)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[French] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 5)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Japanese] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 6)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Korean] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- else if(accent[playerid] == 7)
- {
- new string[256];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s Says[Chinese] %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment