09.06.2016, 23:20
pawn Код:
if(number == 111)
{
format(string, sizeof(string), "* %s takes out their cellphone, pressing a few numbers *", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
SetPlayerAttachedObject(playerid, 0, 330 , 6);
BeingCalled[playerid] = 1;
SendClientMessage(playerid, COLOUR_GREY, "Connecting......");
new am;
foreach(Player, i)
{
if(TaxiDuty[i] == 1)
{
am ++;
}
}
if(am == 0)
{
SendClientMessage(playerid, COLOUR_WHITE, "'I'm really sorry, there are no taxis available at the moment.'");
BeingCalled[playerid] = -1;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
RemovePlayerAttachedObject(playerid, 0);
ClearAnimations(playerid);
}
if(am > 0)
{
SendClientMessage(playerid, COLOUR_YELLOW, "'A taxi has been dispatched to your location, thank you for calling!'");
BeingCalled[playerid] = -1;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
RemovePlayerAttachedObject(playerid, 0);
ClearAnimations(playerid);
foreach(Player, i)
{
if(TaxiDuty[i] == 1)
{
new zone[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(string, sizeof(string), "%s is requesting a taxi at %s, please make your way to their location.", GetNameEx(playerid), zone);
SendClientMessage(i, COLOUR_YELLOW, string);
SetPlayerMarkerForPlayer(playerid, i, COLOUR_YELLOW);
}
}
}
}