[HELP] Problem with CMD (/fare). -
GBLTeam - 21.11.2014
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)
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;
}
Re: [HELP] Problem with CMD (/fare). -
ikey07 - 21.11.2014
at
if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
use
else if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
Re: [HELP] Problem with CMD (/fare). -
GBLTeam - 21.11.2014
pawn Код:
Derror 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "if"
Line:
pawn Код:
else if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
Re: [HELP] Problem with CMD (/fare). -
Rdx - 21.11.2014
Show your functions. if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
Re: [HELP] Problem with CMD (/fare). -
GBLTeam - 21.11.2014
Look if its
= works! But i tried 2 vehicles to work.
Also there no problems in the stocks, so like i told you..
pawn Код:
stock IsSATaxi(vehicleid)
{
for(new i=0; i<19; i++)
{
if(vehicleid == SATaxi[i]) return 1;
}
return 0;
}
stock IsSATaxiL(vehicleid)
{
for(new i=0; i<15; i++)
{
if(vehicleid == SATaxiL[i]) return 1;
}
return 0;
}
Like when im the car i got taxilicense =1 i try /fare 100 its says "Nemate licenca" = "There no taxi license",maybe here is the problem or maybe up because if up is like
it work but i want to make two cars to can work.
pawn Код:
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;
}
}
THIS IS OLD FARE CMD WHICH WAS WORKING:
pawn Код:
CMD:fare(playerid, params[])
{
if(PlayerInfo[playerid][pJob] == JOB_TAXI || PlayerInfo[playerid][pVIPJob] == JOB_TAXI || PlayerInfo[playerid][pTaxiLicense] != 1)
{
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(IsAnTaxi(vehid))
{
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 vozac!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Ti ne si vo Avtomobilot.");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"Ti nemas licanca!");
return 1;
}
return 1;
}
Re: [HELP] Problem with CMD (/fare). -
Rdx - 21.11.2014
Okay. Now tell me why there is a "!" character.
Try to remove it here:
if(!IsSATaxi(GetPlayerVehicleID(playerid)) && !IsSATaxiL(GetPlayerVehicleID(playerid)))
=
if(IsSATaxi(GetPlayerVehicleID(playerid)) && IsSATaxiL(GetPlayerVehicleID(playerid)))
You should remove it here too:
if(!IsTaxiDriver(playerid))
=
if(IsTaxiDriver(playerid))