CMD:fare(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 13)
{
new string[128],sendername[25];
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* You are now Off Duty and earned $%s.", FormatNumber(TransportMoney[playerid]));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
PlayerTextDrawHide(playerid, taxitext[playerid]);
PlayerTextDrawHide(playerid, findtext2[playerid]);
GivePlayerCash(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
return 1;
}
new moneys;
if(sscanf(params, "d",moneys)) return SendClientMessage(playerid, COLOR_WHITE, "{FF9900}Scrie: {33CCFF}/fare <Amount of Money>");
new Veh = GetPlayerVehicleID(playerid);
if(Veh == taxic[1] || Veh == taxic[2] || Veh == taxic[3] || Veh == taxic[4] || Veh == taxic[5] || Veh == taxic[6] || Veh == taxic[7] || Veh == taxic[8] || Veh == taxic[9] || Veh == taxic[10] && PlayerInfo[playerid][pMember] == 13)
{
if(GetPlayerState(playerid) == 2)
{
if(moneys < 5000 || moneys > 5000) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Fare price must be between $1 and $500.");
TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = moneys;
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string, sizeof(string), "{00D900}* Taxi driver %s is now on duty($%s).[/service taxi]", sendername, FormatNumber(TransportValue[playerid]));
SendClientMessageToAll(TEAM_GROVE_COLOR,string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not the driver.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not in a taxi.");
}
}
else
{
SendClientMessage(playerid,COLOR_WHITE, "You are not a taxi driver.");
return 1;
}
}
return 1;
}