21.11.2014, 00:23
I got some problem after i add fare to can work on two vehicles but its not working always giving me the last
"Ti nemas licenca" but before i got an "ptaxilicense =1" .
Old:
NEW (Added by me)
"Ti nemas licenca" but before i got an "ptaxilicense =1" .
Old:
pawn Код:
if(IsAnTaxi(vehid))
pawn Код:
if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
pawn Код:
CMD:fare(playerid, params[])
{
if(!IsTaxiDriver(playerid))
{
new string[128], fare;
if(sscanf(params, "d", fare)) return SendClientMessage(playerid, COLOR_WHITE, "INFO: /fare [cena]");
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* Ti povekje ne si na dolznost i zaraboti $%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveDodMoney(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
if(JobDuty[playerid] != 0) return SendClientMessage(playerid,COLOR_GREY,"Ti mora da ides nadvor od dolznost za da mozes pak /fare.");
new vehid = GetPlayerVehicleID(playerid);
if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
{
if(GetPlayerState(playerid) == 2)
{
if(fare < 1 || fare > 500)
{
SendClientMessage(playerid, COLOR_GREY, " Cenata moze da bide pomegju $1 i $500!");
return 1;
}
TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = fare;
format(string, sizeof(string), "Ti si sega na dolznost kako Taxi Vozac, Cena: $%d.", TransportValue[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
SetPlayerColor(playerid,TEAM_TAXI_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ti ne si taksi vozac!");
return 1;
}
}
else if(IsAnBus(vehid))
{
if(GetPlayerState(playerid) == 2)
{
if(fare < 1 || fare > 500)
{
SendClientMessage(playerid, COLOR_GREY, " Cenata moze da bide pomegju $1 i $500!");
return 1;
}
BusDrivers += 1; TransportDuty[playerid] = 2; TransportValue[playerid]=fare;
format(string, sizeof(string), "Ti si sega na dolznost kako Bus Vozac, Cena: $%d.", TransportValue[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
SetPlayerColor(playerid,TEAM_TAXI_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ti ne si bus vozac!");
return 1;
}
}
else if (PlayerInfo[playerid][pTaxiLicense] == 1)
{
if(GetPlayerState(playerid) == 2)
{
if(fare < 1 || fare > 500)
{
SendClientMessage(playerid, COLOR_GREY, " Cenata mora da bide pomegju $1 i $500!");
return 1;
}
TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = fare;
format(string, sizeof(string), "Ti si sega na dolznost kako Taxi Vozac, cena: $%d.", TransportValue[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
SetPlayerColor(playerid,TEAM_TAXI_COLOR);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Ti ne si Taksista!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Ti ne si vo Avtomobilot.");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Ti nemas licanca!");
return 1;
}
return 1;
}