19.03.2013, 15:37
Whatever I type it sends it two times in the chat box, chat, commands , or whatever,, I use strcmp
public OnPlayerText(playerid, text[])
{
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new tmp[256];
new string[256];
new giveplayerid;
GetPlayerName(playerid, sendername, sizeof(sendername));
if(gPlayerLogged[playerid] == 0) {return false;}
if(MedicTime[playerid] > 0)
{
SendClientMessage(playerid,COLOR_LIGHTRED,"ERROR: You are resting...");
return false;
}
if(Account[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return false;
}
if(BankSteal[playerid] != 0)
{
if(BankSteal[playerid] != 0)
{
if(StealBank[playerid] < 999)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You are still trying to hack the accounts, if don't want type /cancelrobbery.");
return false;
}
if(!IsNumeric(text)) { SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Choose one number only..."); return false;}
new idle;
tmp = strtok(text, idle);
if(BankSteal[playerid] != strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "The bank assistant has noticed a beep and came to see whats going on...");
SendClientMessage(playerid, COLOR_YELLOW, "All accounts have been automaticly locked and you can't steal anything.");
TextDrawSetString(Textdrawz[playerid],"~w~Info: You better ~r~RUN AWAY~w~ before you get caught by the cops.");
TextDrawShowForPlayer(playerid,Textdrawz[playerid]);
NoText[playerid]=5;
Account[playerid][pBankSteal] = 7;
BankSteal[playerid] = 0;
StealBank[playerid] = 999;
OnPlayerUpdate(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
RobbingBank=1;
Account[playerid][pBankSteal] = 5;
BankSteal[playerid] = 0;
new rand = 500+random(7000);
GiveMoney(playerid, rand);
BankRob[playerid] = rand;
ApplyEndAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 0); //Rob
SetTimerEx("GetSafe", 120000, 0, "d", playerid);
SendClientMessage(playerid, COLOR_YELLOW, "Congratulations!! You have just robbed a Bank Account...");
SendClientMessage(playerid, COLOR_YELLOW, "Now Leave fast the cops have been alerted...");
SendClientMessage(playerid, COLOR_WHITE, "HINT: Do not leave the server while the running or you will loose that money.");
TogglePlayerControllable(playerid, true);
return false;
}
return false;
}
if(BankTransfer[playerid] > 0)
{
if(BankTransfer[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("yes", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("yes")))
{
BankTransfer[playerid] = 2;
SendClientMessage(playerid, COLOR_YELLOW, "Please type his Name and the Amount.");
return false;
}
else if((strcmp("no", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("no")))
{
BankTransfer[playerid] = 0;
SendClientMessage(playerid, COLOR_YELLOW, " You cancelled the Bank Transfer ");
return false;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Do you really want to writte a check to someone? Type Yes or No ");
}
return false;
}
else if(BankTransfer[playerid] == 2)
{
new playermoney;
new idx;
new moneys;
tmp = strtok(text, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Please type [playerid/PartOfName] [amount]");
return false;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(text, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Please type [playerid/PartOfName] [amount]");
return false;
}
moneys = strvalEx(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
playermoney = Account[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
Account[playerid][pAccount] -= moneys;
Account[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), " You have transferd $%d to %s's account", moneys, giveplayer,giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d to into your account from %s", moneys, Account[playerid][pName], playerid);
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
BankTransfer[playerid] = 0;
format(string, sizeof(string), "%s transferd $%d to %s", Account[playerid][pName], moneys, giveplayer);
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
return false;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Invalid transaction amount.");
return false;
}
}
}
else
{
format(string, sizeof(string), "ERROR: %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
return false;
}
}
return false;
}
/*if(BankCard1[playerid] > 0)
{
if(BankCard1[playerid] == 1)
{
new idx;
new combo;
tmp = strtok(text, idx);
combo = strvalEx(tmp);
if(combo < 1000 && combo < 9999)
{
format(string, sizeof(string), "Tip: Insert the Pin Code please (4 Digits xxxx)");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
return false;
}
Account[playerid][pBankPin] = combo;
Account[playerid][pBankCard] = 1;
BankCard1[playerid] = 0;
TogglePlayerControllable(playerid, true);
TextDrawSetString(Textdrawz[playerid],"~w~Info: You have made a ~r~Credit Card ~w~Do not forget your password.");
TextDrawShowForPlayer(playerid,Textdrawz[playerid]);
NoText[playerid]=5;
OnPlayerUpdate(playerid);
return false;
}
}*/
if(RegistrationStep[playerid] > 0)
{
if(RegistrationStep[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("male", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("male")))
{
Account[playerid][pSex] = 1;
SetPlayerSkin(playerid, 101);
Account[playerid][pModel] = 101;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Male.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "What is your Age?");
RegistrationStep[playerid] = 2;
return false;
}
else if((strcmp("female", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("female")))
{
Account[playerid][pSex] = 2;
SetPlayerSkin(playerid, 12);
Account[playerid][pModel] = 12;
SendClientMessage(playerid, COLOR_YELLOW2, "Ok, so you are a Female.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "What is your Age?");
RegistrationStep[playerid] = 2;
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "I'll repeat the question, Are you a Male or a Female?");
}
return false;
}
else if(RegistrationStep[playerid] == 2)
{
new idx;
if(!IsNumeric(text)) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Numbers Only...");
tmp = strtok(text, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Please type your Age...");
return false;
}
new moneys;
moneys = strvalEx(tmp);
if(moneys < 10)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Isn't that too young??");
return false;
}
if(moneys > 99)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Isn't that too old??");
return false;
}
Account[playerid][pAge] = moneys;
format(string, sizeof(string), "Ok, so you are %d year old.",Account[playerid][pAge]);
SendClientMessage(playerid, COLOR_YELLOW2, string);
SendClientMessage(playerid, COLOR_WHITE, " ");
RegistrationStep[playerid] = 4;
Account[playerid][pSpawn] = 1;
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
else if(RegistrationStep[playerid] == 4)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("plane", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("plane")))
{
Account[playerid][pSpawn] = 1;
SendClientMessage(playerid, COLOR_YELLOW2, "You will arrive on a plane at Airport.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to pay attention to our tutorial.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
else if((strcmp("bus", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("bus")))
{
Account[playerid][pSpawn] = 2;
SendClientMessage(playerid, COLOR_WHITE, "You will arrive on a bus choose your location (Type in: Unity or Vinewood)");
SendClientMessage(playerid, COLOR_WHITE, " ");
RegistrationStep[playerid] = 5;
return false;
}
else if((strcmp("train", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("train")))
{
Account[playerid][pSpawn] = 3;
SendClientMessage(playerid, COLOR_WHITE, "You will arrive on a bus choose your location (Type in: Unity or Jefferson)");
SendClientMessage(playerid, COLOR_WHITE, " ");
RegistrationStep[playerid] = 5;
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "How you want to Arrive? (Type in: Plane, Bus, Train)");
return false;
}
}
else if(RegistrationStep[playerid] == 5)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("vinewood", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("vinewood")))
{
if(Account[playerid][pSpawn] == 2)
{
Account[playerid][pSpawn] = 4;
SendClientMessage(playerid, COLOR_YELLOW2, "You will arrive on a bus at Vinewood.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to pay attention to our tutorial.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
}
else if((strcmp("unity", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("unity")))
{
if(Account[playerid][pSpawn] == 2)
{
Account[playerid][pSpawn] = 5;
SendClientMessage(playerid, COLOR_YELLOW2, "You will arrive on a bus at Unity.");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to pay attention to our tutorial.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
else if(Account[playerid][pSpawn] == 3)
{
Account[playerid][pSpawn] = 6;
SendClientMessage(playerid, COLOR_YELLOW2, "You will arrive on a train at Unity.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to pay attention to our tutorial.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
}
else if((strcmp("jefferson", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("jefferson")))
{
if(Account[playerid][pSpawn] == 3)
{
Account[playerid][pSpawn] = 7;
SendClientMessage(playerid, COLOR_YELLOW2, "You will arrive on a train at Jefferson.");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to pay attention to our tutorial.");
RegistrationStep[playerid] = 0;
TutTime[playerid] = 1;
return false;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You will arrive on a bus choose your location (Type in: Unity or Vinewood)");
return false;
}
}
return false;
}
if(DrivingQuestion[playerid] >= 1)
{
if(DrivingQuestion[playerid] == 50)
{
return false;
}
if(DrivingQuestion[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
{
SendClientMessage(playerid, COLOR_WHITE, "Correct");
DrivingQuestion[playerid] = 50;
SetTimerEx("DC2", 5000, 0, "d", playerid);
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
DrivingQuestion[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to start again...");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
}
else if(DrivingQuestion[playerid] == 2)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
{
SendClientMessage(playerid, COLOR_WHITE, "Correct");
Question[playerid] = 50;
SetTimerEx("DC3", 5000, 0, "d", playerid);
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
DrivingQuestion[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to start again...");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
}
else if(DrivingQuestion[playerid] == 3)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
{
SendClientMessage(playerid, COLOR_WHITE, "Correct");
DrivingQuestion[playerid] = 50;
SetTimerEx("DC4", 5000, 0, "d", playerid);
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
DrivingQuestion[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to start again...");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
}
else if(DrivingQuestion[playerid] == 4)
{
new idx;
tmp = strtok(text, idx);
if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
{
SendClientMessage(playerid, COLOR_WHITE, "Correct");
DrivingQuestion[playerid] = 0;
DrivingTestingStart[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW2, "Now you can start your Physical Test Skills");
SendClientMessage(playerid, COLOR_YELLOW2, "Go outside and get inside a Driving Test Car.");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
DrivingQuestion[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, "Now you have to start again...");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
return false;
}
}
}
if(Question[playerid] > 0)
{
if(Question[playerid] == 50) {return false;}
if(Question[playerid] == 1)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
{
TextDrawSetString(Tutorial1[playerid],"~b~~n~~n~ | Correct! | ~n~");
TextDrawShowForPlayer(playerid,Tutorial1[playerid]);
Question[playerid] = 50;
SetTimerEx("Q2", 2000, 0, "d", playerid);
return false;
}
else
{
Account[playerid][pSpawn] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
Question[playerid] = 0;
Kick(playerid);
return false;
}
}
else if(Question[playerid] == 2)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
{
TextDrawSetString(Tutorial1[playerid],"~b~~n~~n~ | Correct! | ~n~");
TextDrawShowForPlayer(playerid,Tutorial1[playerid]);
Question[playerid] = 50;
SetTimerEx("Q3", 2000, 0, "d", playerid);
return false;
}
else
{
Account[playerid][pSpawn] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
Question[playerid] = 0;
Kick(playerid);
return false;
}
}
else if(Question[playerid] == 3)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("2", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("2")))
{
TextDrawSetString(Tutorial1[playerid],"~b~~n~~n~ | Correct! | ~n~");
TextDrawShowForPlayer(playerid,Tutorial1[playerid]);
Question[playerid] = 50;
SetTimerEx("Q4", 2000, 0, "d", playerid);
return false;
}
else
{
Account[playerid][pSpawn] = 0;
SendClientMessage(playerid, COLOR_LIGHTRED, "Incorrect");
Question[playerid] = 0;
Kick(playerid);
return false;
}
}
else if(Question[playerid] == 4)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
{
TextDrawSetString(Tutorial1[playerid],"~b~~n~~n~ | Correct! | ~n~");
TextDrawShowForPlayer(playerid,Tutorial1[playerid]);
Question[playerid] = 50;
SetTimerEx("Q5", 2000, 0, "d", playerid);
return false;
}
else
{
Account[playerid][pSpawn] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
Question[playerid] = 0;
Kick(playerid);
return false;
}
}
else if(Question[playerid] == 5)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("1", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("1")))
{
TextDrawSetString(Tutorial1[playerid],"~b~~n~~n~ | Correct! | ~n~");
TextDrawShowForPlayer(playerid,Tutorial1[playerid]);
Question[playerid] = 50;
SetTimerEx("Q6",2000, 0, "d", playerid);
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
Question[playerid] = 0;
Kick(playerid);
Account[playerid][pSpawn] = 0;
return false;
}
}
else if(Question[playerid] == 6)
{
new idx;
tmp = strtok(text, idx);
if(!IsNumeric(text))
{
SendClientMessage(playerid, COLOR_WHITE, "ERROR: Please only a number...");
return false;
}
if((strcmp("3", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("3")))
{
ClearChatbox(playerid, 6);
SendClientMessage(playerid, COLOR_YELLOW2, "Welcome to Santos RolePlay.");
SendClientMessage(playerid, COLOR_GRAD1, "Hint: To change your outfit you have to go to clothes shop");
SendClientMessage(playerid, COLOR_WHITE, "Hint: There is a 'i' Icon beside you, Type /pickguide to obtain a guidebook.");
SendClientMessage(playerid, COLOR_WHITE, "Hint: There is available rooms at the motel, look on your GPS for a red house icon");
SendClientMessage(playerid, COLOR_GREEN, "{0080FF}(( If you need any help please use /helpme, /report is for only Rule Breakers. ))");
TextDrawHideForPlayer(playerid,Tutorial1[playerid]);
gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
TogglePlayerControllable(playerid, true);
Question[playerid] = 0;
SetPlayerVirtualWorld(playerid,0);
Account[playerid][pVirtualWorld] = 0;
Account[playerid][pInt] = 0;
TutTime[playerid] =0;
OnPlayerUpdate(playerid);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
Account[playerid][pInt] = 0;
Account[playerid][pTut] = 1;
FirstSpawn[playerid] = 0;
if(Account[playerid][pSpawn] == 1)//airport
{
SetPlayerPos(playerid,954.6555,-1702.3538,15.3847);
SetPlayerFacingAngle(playerid, 90);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
Account[playerid][pInt] = 0;
}
else if(Account[playerid][pSpawn] == 4)//bus vinewood
{
SetPlayerPos(playerid,954.6555,-1702.3538,15.3847);
SetPlayerFacingAngle(playerid, 90);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
Account[playerid][pInt] = 0;
TogglePlayerControllable(playerid, true);
}
else if(Account[playerid][pSpawn] == 5)//bus unity
{
SetPlayerPos(playerid,954.6555,-1702.3538,15.3847);
SetPlayerFacingAngle(playerid, 90);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
TogglePlayerControllable(playerid, true);
Account[playerid][pInt] = 0;
}
else if(Account[playerid][pSpawn] == 6)//train unity
{
SetPlayerPos(playerid,954.6555,-1702.3538,15.3847);
SetPlayerFacingAngle(playerid, 90);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
Account[playerid][pInt] = 0;
TogglePlayerControllable(playerid, true);
}
else if(Account[playerid][pSpawn] == 7)//train jefferson
{
SetPlayerPos(playerid,954.6555,-1702.3538,15.3847);
SetPlayerFacingAngle(playerid, 90);
SetPlayerInterior(playerid,0);
Account[playerid][pInt] = 0;
TogglePlayerControllable(playerid, true);
}
return false;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Incorrect");
Question[playerid] = 0;
Account[playerid][pSpawn] = 0;
Kick(playerid);
return false;
}
}
return false;
}
if(CallLawyer[playerid] == 111)
{
new idx;
tmp = strtok(text, idx);
if ((strcmp("yes", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("yes")))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "** %s is in Jail, and needs a Lawyer. Go to the Police Station.", sendername);
SendJobMessage(2, TEAM_AZTECAS_COLOR, string);
SendJobMessage(2, TEAM_AZTECAS_COLOR, "* When you are at the Police Station, ask an Officer to approve you with /accept lawyer.");
SendClientMessage(playerid, COLOR_LIGHTRED, "A message has been sent to all available Lawyers, please wait.");
WantLawyer[playerid] = 0;
CallLawyer[playerid] = 0;
return false;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "There is no Lawyer available to you anymore, Jail Time started.");
WantLawyer[playerid] = 0;
CallLawyer[playerid] = 0;
return false;
}
}
if(TalkingLive[playerid] != 255)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Account[playerid][pJob] == 6)
{
format(string, sizeof(string), "LiveNR %s: %s", Account[playerid][pName], text);
OOCNews(COLOR_LIGHTGREEN, string);
}
else
{
format(string, sizeof(string), "LivePlayer %s: %s", Account[playerid][pName], text);
OOCNews(COLOR_LIGHTGREEN, string);
}
return false;
}
if(Mobile[playerid] != 255)
{
new idx;
tmp = strtok(text, idx);
new namez0r[MAX_PLAYER_NAME];
if(HiddenName[playerid] == 1) { namez0r = "Stranger"; }
else { format(namez0r, sizeof(namez0r), "%s", Account[playerid][pName]); }
format(string, sizeof(string), "%s Says (cellphone): %s",namez0r, 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 false;
}
new turner[MAX_PLAYER_NAME];
new wanted[128];
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);
GetPlayerName(playerid, turner, sizeof(turner));
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Police HQ: We have alerted all units in the area.");
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this Incident");
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",text);
SendFamilyMessage(1, COLOR_DBLUE, wanted);
SendClientMessage(playerid, COLOR_GRAD2, "They Hung Up...");
new Float:trace_x, Float:trace_y, Float:trace_z;
GetPlayerPos(playerid, trace_x, trace_y, trace_z);
trace1 = 1; trace1_x = trace_x; trace1_y = trace_y; trace1_z = trace_z;
Mobile[playerid] = 255;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
return false;
}
if(Mobile[playerid] == 912)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand?");
return false;
}
new turner[MAX_PLAYER_NAME];
new wanted[128];
GetPlayerName(playerid, turner, sizeof(turner));
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Police HQ: We have alerted all units in the area.");
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this crime");
format(wanted, sizeof(wanted), "HQ: All Units APB: Reporter: %s",turner);
SendFamilyMessage(1, TEAM_CYAN_COLOR, wanted);
format(wanted, sizeof(wanted), "HQ: Crime: %s, Suspect: Unknown",text);
SendFamilyMessage(1, TEAM_CYAN_COLOR, wanted);
SendClientMessage(playerid, COLOR_WHITE, "They Hung Up...");
new Float:trace_x, Float:trace_y, Float:trace_z;
GetPlayerPos(playerid, trace_x, trace_y, trace_z);
pdtrace = 1; pdtrace_x = trace_x; pdtrace_y = trace_y; pdtrace_z = trace_z;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
Mobile[playerid] = 255;
return false;
}
if(Mobile[playerid] == 1000)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand?");
return false;
}
new turner[MAX_PLAYER_NAME];
new wanted[128];
format(wanted, sizeof(wanted), "Dispatch: All Units IA: Caller: %s Caller Number: %d",Account[playerid][pName], Account[playerid][pPnumber]);
SendTeamBeepMessage(4, TEAM_CYAN_COLOR, wanted);
format(wanted, sizeof(wanted), "Dispatch: Incident: %s",text);
SendTeamMessage(4, TEAM_CYAN_COLOR, wanted);
GetPlayerName(playerid, turner, sizeof(turner));
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Police HQ: We have alerted all units in the area.");
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Thank you for reporting this Incident");
format(wanted, sizeof(wanted), "HQ: All Units APB: Reporter: %s",turner);
SendFamilyMessage(1, TEAM_CYAN_COLOR, wanted);
SendTeamMessage(4, TEAM_CYAN_COLOR, wanted);
format(wanted, sizeof(wanted), "HQ: Crime: %s, Suspect: Unknown",text);
SendFamilyMessage(1, TEAM_CYAN_COLOR, wanted);
SendClientMessage(playerid, COLOR_WHITE, "They Hung Up...");
new Float:trace_x, Float:trace_y, Float:trace_z;
GetPlayerPos(playerid, trace_x, trace_y, trace_z);
trace1 = 1; trace1_x = trace_x; trace1_y = trace_y; trace1_z = trace_z;
pdtrace = 1; pdtrace_x = trace_x; pdtrace_y = trace_y; pdtrace_z = trace_z;
Mobile[playerid] = 255;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
return false;
}
if(Mobile[playerid] == 911)
{
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand, police, medic or both?");
return false;
}
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, TEAM_CYAN_COLOR, "Police HQ: Please give me a short description of the crime.");
return false;
}
else if ((strcmp("medic", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("medic")))
{
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 false;
}
else if ((strcmp("both", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("both")))
{
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: I am patching you to Police/Medic HQ, please hold.");
Mobile[playerid] = 1000;
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Dispatch: Please give me a short description of the Incident.");
return false;
}
else
{
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Sorry i don't understand, police, medic or both??");
return false;
}
}
if(IsPlayerConnected(Mobile[playerid]))
{
if(Mobile[Mobile[playerid]] == playerid)
{
SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW,"Theres nobody there");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
}
return false;
}
if(realchat)
{
if(TutTime[playerid] > 0) {return false;}
if(gPlayerLogged[playerid] == 1)
{
new idx;
new length = strlen(text);
while ((idx < length) && (text[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = text[idx];
idx++;
}
result[idx - offset] = EOS;
new namez0r[MAX_PLAYER_NAME];
if(HiddenName[playerid] == 1) { namez0r = "Stranger"; }
else { format(namez0r, sizeof(namez0r), "%s", Account[playerid][pName]); }
new language[20];
if(Account[playerid][pLanguage] == 0) { language = "(English)"; }
else if(Account[playerid][pLanguage] == 1) { language = "(Spanish)"; }
else if(Account[playerid][pLanguage] == 2) { language = "(Italian)"; }
else if(Account[playerid][pLanguage] == 3) { language = "(German)"; }
else if(Account[playerid][pLanguage] == 4) { language = "(Russian)"; }
else if(Account[playerid][pLanguage] == 5) { language = "(Portuguese)"; }
else if(Account[playerid][pLanguage] == 6) { language = "(Japanese)"; }
else {language = "(English)"; }
if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && UsingAnim[playerid]==0 && PlayerCuffed[playerid] == 0 && PlayerCuffed1[playerid] == 0 && tazed[playerid] == 0 && MedicTime[playerid] == 0 && PlayerDrugging[playerid] == 0)
{
ApplyAnimation(playerid, "PED","IDLE_CHAT", 4.1, 1, 1, 1, 1, 1);
SetTimerEx("ShutIt", strlen(text)*150, 0, "d", playerid);
}
format(string, sizeof(string), "%s Says %s: %s",namez0r, language, result);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return false;
}
}
else
{
if(TutTime[playerid] > 0) {return false;}
if(gPlayerLogged[playerid] == 1)
{
new idx;
new length = strlen(text);
while ((idx < length) && (text[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = text[idx];
idx++;
}
result[idx - offset] = EOS;
new namez0r[MAX_PLAYER_NAME];
if(HiddenName[playerid] == 1) { namez0r = "Stranger"; }
else { format(namez0r, sizeof(namez0r), "%s", Account[playerid][pName]); }
new language[20];
if(Account[playerid][pLanguage] == 0) { language = "(English)"; }
else if(Account[playerid][pLanguage] == 1) { language = "(Spanish)"; }
else if(Account[playerid][pLanguage] == 2) { language = "(Italian)"; }
else if(Account[playerid][pLanguage] == 3) { language = "(German)"; }
else if(Account[playerid][pLanguage] == 4) { language = "(Russian)"; }
else if(Account[playerid][pLanguage] == 5) { language = "(Portuguese)"; }
else if(Account[playerid][pLanguage] == 6) { language = "(Japanese)"; }
else {language = "(English)"; }
if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && UsingAnim[playerid]==0 && PlayerCuffed[playerid] == 0 && PlayerCuffed1[playerid] == 0 && tazed[playerid] == 0 && MedicTime[playerid] == 0 && PlayerDrugging[playerid] == 0)
{
ApplyAnimation(playerid, "PED","IDLE_CHAT", 4.1, 1, 1, 1, 1, 1);
SetTimerEx("ShutIt", strlen(text)*150, 0, "d", playerid);
}
format(string, sizeof(string), "%s Says %s: %s",namez0r, language, result);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
return false;
}
}
return false;
}