Код:
if(strcmp(cmd, "/pickup", true) == 0 || strcmp(cmd, "/p", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(Mobile[playerid] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, " Vec pricate sa nekim...");
return 1;
}
foreach (Player, i)
{
if(Mobile[i] == playerid)
{
Mobile[playerid] = i; //caller connecting
SendClientMessage(i, COLOR_GRAD2, " Javio/Javila se.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s se javio na mobitel.", sendername);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
SetPlayerAttachedObject(playerid, 4, 18866, 6, 0.0836, 0.0139, 0.0120, 260.6226, 355.9293, 160.3545, 1.0000, 1.0000, 1.0000);
TextDrawShowForPlayer(playerid, Text0);
TextDrawShowForPlayer(playerid, Text1);
TextDrawShowForPlayer(playerid, Text2);
TextDrawShowForPlayer(playerid, Text3);
TextDrawShowForPlayer(playerid, Text4);
TextDrawShowForPlayer(playerid, Text5);
TextDrawShowForPlayer(playerid, Text6);
TextDrawShowForPlayer(playerid, Text7);
TextDrawShowForPlayer(playerid, Text8);
TextDrawShowForPlayer(playerid, Text9);
TextDrawShowForPlayer(playerid, Text10);
TextDrawShowForPlayer(playerid, Text11);
TextDrawShowForPlayer(playerid, Text12);
TextDrawShowForPlayer(playerid, Text13);
TextDrawShowForPlayer(playerid, Text14);
TextDrawShowForPlayer(playerid, Text15);
TextDrawShowForPlayer(playerid, Text16);
TextDrawShowForPlayer(playerid, Text17);
TextDrawShowForPlayer(playerid, Text18);
TextDrawShowForPlayer(playerid, Text19);
TextDrawShowForPlayer(playerid, Text20);
TextDrawShowForPlayer(playerid, Text21);
TextDrawShowForPlayer(playerid, Text22);
TextDrawShowForPlayer(playerid, Text23);
TextDrawShowForPlayer(playerid, Text24);
TextDrawShowForPlayer(playerid, Text25);
TextDrawShowForPlayer(playerid, Text26);
TextDrawShowForPlayer(playerid, Text27);
TextDrawShowForPlayer(playerid, Text28);
TextDrawShowForPlayer(playerid, Text29);
TextDrawShowForPlayer(playerid, Text30);
TextDrawShowForPlayer(playerid, Text31);
TextDrawShowForPlayer(playerid, Text32);
TextDrawShowForPlayer(playerid, Text33);
TextDrawShowForPlayer(playerid, Text34);
TextDrawShowForPlayer(playerid, Text35);
TextDrawShowForPlayer(playerid, Text36);
TextDrawShowForPlayer(playerid, Text37);
TextDrawShowForPlayer(playerid, Text38);
TextDrawShowForPlayer(playerid, Text39);
TextDrawShowForPlayer(playerid, Text40);
TextDrawShowForPlayer(playerid, Text41);
TextDrawShowForPlayer(playerid, Text42);
TextDrawShowForPlayer(playerid, Text43);
TextDrawShowForPlayer(playerid, Text44);
TextDrawShowForPlayer(playerid, Text45);
TextDrawShowForPlayer(playerid, Text46);
TextDrawShowForPlayer(playerid, Text47);
TextDrawShowForPlayer(playerid, Text48);
TextDrawShowForPlayer(playerid, Text49);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
RingTone[playerid] = 0;
}
}
}
return 1;
}
Код:
if(strcmp(cmd, "/call", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /call [Broj]");
SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /calllist (for a list for short numbers)");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nemate telefon!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s je uzeo mobitel iz dzepa.", sendername);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
SetPlayerAttachedObject(playerid, 4, 18866, 6, 0.0836, 0.0139, 0.0120, 260.6226, 355.9293, 160.3545, 1.0000, 1.0000, 1.0000);
TextDrawShowForPlayer(playerid, Text0);
TextDrawShowForPlayer(playerid, Text1);
TextDrawShowForPlayer(playerid, Text2);
TextDrawShowForPlayer(playerid, Text3);
TextDrawShowForPlayer(playerid, Text4);
TextDrawShowForPlayer(playerid, Text5);
TextDrawShowForPlayer(playerid, Text6);
TextDrawShowForPlayer(playerid, Text7);
TextDrawShowForPlayer(playerid, Text8);
TextDrawShowForPlayer(playerid, Text9);
TextDrawShowForPlayer(playerid, Text10);
TextDrawShowForPlayer(playerid, Text11);
TextDrawShowForPlayer(playerid, Text12);
TextDrawShowForPlayer(playerid, Text13);
TextDrawShowForPlayer(playerid, Text14);
TextDrawShowForPlayer(playerid, Text15);
TextDrawShowForPlayer(playerid, Text16);
TextDrawShowForPlayer(playerid, Text17);
TextDrawShowForPlayer(playerid, Text18);
TextDrawShowForPlayer(playerid, Text19);
TextDrawShowForPlayer(playerid, Text20);
TextDrawShowForPlayer(playerid, Text21);
TextDrawShowForPlayer(playerid, Text22);
TextDrawShowForPlayer(playerid, Text23);
TextDrawShowForPlayer(playerid, Text24);
TextDrawShowForPlayer(playerid, Text25);
TextDrawShowForPlayer(playerid, Text26);
TextDrawShowForPlayer(playerid, Text27);
TextDrawShowForPlayer(playerid, Text28);
TextDrawShowForPlayer(playerid, Text29);
TextDrawShowForPlayer(playerid, Text30);
TextDrawShowForPlayer(playerid, Text31);
TextDrawShowForPlayer(playerid, Text32);
TextDrawShowForPlayer(playerid, Text33);
TextDrawShowForPlayer(playerid, Text34);
TextDrawShowForPlayer(playerid, Text35);
TextDrawShowForPlayer(playerid, Text36);
TextDrawShowForPlayer(playerid, Text37);
TextDrawShowForPlayer(playerid, Text38);
TextDrawShowForPlayer(playerid, Text39);
TextDrawShowForPlayer(playerid, Text40);
TextDrawShowForPlayer(playerid, Text41);
TextDrawShowForPlayer(playerid, Text42);
TextDrawShowForPlayer(playerid, Text43);
TextDrawShowForPlayer(playerid, Text44);
TextDrawShowForPlayer(playerid, Text45);
TextDrawShowForPlayer(playerid, Text46);
TextDrawShowForPlayer(playerid, Text47);
TextDrawShowForPlayer(playerid, Text48);
TextDrawShowForPlayer(playerid, Text49);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
/*if(phonenumb == list)
{
SendClientMessage(playerid, COLOR_GREEN, "________________Lista Sluzbi________________");
SendClientMessage(playerid, COLOR_WHITE, "111 - picerija., 222 - bus sluzba");
SendClientMessage(playerid, COLOR_WHITE, "103 - bolnicari, 444 - taxi, 555 - mehanicar");
SendClientMessage(playerid, COLOR_GREEN, "____________________________________________");
return 1;
}*/
if(phonenumb == 111)
{
new pizzaworkers = 0;
foreach (Player, i)
{
if(PlayerInfo[i][pJob] == 17 && JobDuty[i] == 1)
{
pizzaworkers++;
}
}
if(pizzaworkers < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Javili su se.");
SendClientMessage(playerid, 0xF4E19FAA, "Radnik (telefon): Halo, Picerija ovdje.");
SendClientMessage(playerid, 0xF4E19FAA, "Radnik (telefon): Zao nam je, trenutno nemamo slobodnih raznosaca pica.");
SendClientMessage(playerid, COLOR_GREY, " Prekinuli su.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "** %s je narucio picu. (koristite /prihvati Pizza da prihvatite narudzbu)", sendername);
SendJobMessage(17, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREY, " Javili su se.");
SendClientMessage(playerid, 0xF4E19DAA, "Radnik (telefon): Halo, Picerija ovdje.");
if(pizzaworkers == 1) { format(string, sizeof(string), "Radnik (telefon): Gospodine, poslali smo jednog raznosaca da vam donese picu."); }
else { format(string, sizeof(string), "Radnik (telefon): Trenutno imamo %d raznosaca pica na duznosti, svima je javljeno za vasu narudzbu !", pizzaworkers); }
SendClientMessage(playerid, 0xF4E19DAA, string);
SendClientMessage(playerid, COLOR_GREY, " Prekinuli su.");
PizzaCall = playerid;
return 1;
}
if(phonenumb == 222)
{
new routezonecheck = IsInBusrouteZone(playerid);
new drivercount = 0;
if (routezonecheck == 0)
{
for (new i=0; i<=MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && BusrouteEast[i][0] != 0) drivercount++;
}
if (drivercount != 0)
{
format(string, sizeof(string), "Trenutno ima %d vozaca autobusa na istocnoj ruti. Sledeca stajanja:", drivercount);
SendClientMessage(playerid, COLOR_WHITE, string);
SendBusRoute(playerid, 0);
}
else SendClientMessage(playerid, COLOR_GREY, "Nema trenutno vozaca busa na istocnoj ruti.");
}
else if (routezonecheck == 1)
{
for (new i=0; i<=MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && BusrouteWest[i][0] != 0) drivercount++;
}
if (drivercount != 0)
{
format(string, sizeof(string), "Trenutno ima %d vozaca autobusa na zapadnoj ruti. Sledeca stajanja:", drivercount);
SendClientMessage(playerid, COLOR_WHITE, string);
SendBusRoute(playerid, 1);
}
else SendClientMessage(playerid, COLOR_GREY, "Nema vozaca na zapadnoj ruti.");
}
else SendClientMessage(playerid, COLOR_GREY, "Trenutno nema vozaca autobusa.");
return 1;
}
/*if(phonenumb == 103)
{
if(Medics < 1)
{
SendClientMessage(playerid, COLOR_GREY, " There are no Medics On Duty at the moment, try again later !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "** %s is in need of a Medic. (use /accept medic to accept the call)", sendername);
SendRadioMessage(4, TEAM_AZTECAS_COLOR, string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You have called for a Medic, wait for a reply.");
MedicCall = playerid;
return 1;
}*/
if(phonenumb == 444)
{
if(TaxiDrivers < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Javili su se.");
SendClientMessage(playerid, 0xF4E19FAA, "Dispacer (telefon): Taxi Kompanija ovjde.Izvinite ali trenutno nemamo slobodnih vozaca.");
SendClientMessage(playerid, COLOR_GREY, " Prekinuli su.");
return 1;
}
if(TransportDuty[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " Ne mozete sada zvati taksi !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "** %s-u treba taksi. (kucajte /prihvati taxi da prihvatite poziv)", sendername);
SendFamilyMessage(10, TEAM_AZTECAS_COLOR, string);
SendClientMessage(playerid, COLOR_GREY, " Prihvatili su poziv.");
SendClientMessage(playerid, 0xF4E19FAA, "Dispacer (telefon): Svi taksisti su informisani o vasem pozivu.");
SendClientMessage(playerid, COLOR_GREY, " Prekinuli su.");
TaxiCall = playerid;
return 1;
}
if(phonenumb == 555)
{
new mechanicworkers = 0;
foreach (Player, i)
{
if(PlayerInfo[i][pJob] == 7 && JobDuty[i] == 1)
{
mechanicworkers++;
}
}
if(mechanicworkers < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Javili su se.");
SendClientMessage(playerid, 0xBBE1F2AA, "Vlasnik (telefon): Zao nam je ali trenutno nemamo slobodnih automehanicara.");
SendClientMessage(playerid, COLOR_GREY, " They hang up.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "** %s-u treba automehanicar. (kucajte /prihvati mechanic da prihvatite poziv)", sendername);
SendJobMessage(7, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREY, " Prihvatili su poziv.");
SendClientMessage(playerid, 0xBBE1F2AA, "Vlasnik (telefon): Svim mehanicarima je javljeno o vasem pozivu.");
SendClientMessage(playerid, COLOR_GREY, " Prekinuli su.");
MechanicCall = playerid;
return 1;
}
if(phonenumb == 3900)
{
SendClientMessage(playerid, COLOR_GREEN, "CNN Studio: Molimo vas ostavite poruku poslije zvuka **beep**!");
SendClientMessage(playerid, COLOR_WHITE, "Beep!");
Mobile[playerid] = 3900;
return 1;
}
if(phonenumb == 911)
{
SendClientMessage(playerid, COLOR_WHITE, "Podjsetnik: Sada koristite ~ ili T da pricate preko telefona, kucajte /hangup ili /h da prekinete");
SendClientMessage(playerid, COLOR_ALLDEPT, "EMERGENCY: Koja vam sluzba treba, policija ili hitna_pomoc? (kucajte policija ili hitna_pomoc)?");
Mobile[playerid] = 911;
return 1;
}
if(phonenumb == PlayerInfo[playerid][pPnumber])
{
SendClientMessage(playerid, COLOR_GRAD2, " Zauzeto je...");
return 1;
}
if(Mobile[playerid] != 255)
{
SendClientMessage(playerid, COLOR_GRAD2, " Vec zovete nekog...");
return 1;
}
foreach (Player, i)
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PhoneOnline[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Trenutni korisnik je nedostupan molimo nazovite kasnije...");
return 1;
}
if (Mobile[giveplayerid] == 255)
{
format(string, sizeof(string), "Zvoni vam mobite, kucajte (/pickup da se javite) Pozivatelj: %s", sendername);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
RingTone[giveplayerid] = 10;
format(string, sizeof(string), "* %s mobitel zvoni.", sendername);
SendClientMessage(playerid, COLOR_WHITE, "Podjsetnik: Sada koristite ~ ili T da pricate preko telefona, kucajte /hangup ili /h da prekinete");
ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
CellTime[playerid] = 1;
return 1;
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, " Zauzeto je...");
}
return 1;
}
Look at the video, problem is in /hangup command, i want that the player put mobile in pocket, not that mobile disappears immidiately