29.07.2013, 11:54
Hello, I am trying to add this taxi system to my gamemode but it keeps giving me errors
This is the taxi script :
These are the errors:
Here it is the 2 lines where I get the errors:
Thanks !
This is the taxi script :
Код:
CMD:fare(playerid, params[]) { if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10|| PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pTaxiLicense] == 1) { new string[128], fare; if(sscanf(params, "d", fare)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fare [price]"); if(TransportDuty[playerid] > 0) { if(TransportDuty(playerid) == 1) { TaxiDrivers -= 1; } else if(TransportDuty[playerid] == 2) { BusDrivers -= 1; } TransportDuty[playerid] = 0; format(string, sizeof(string), "* You are now off duty and earned $%d.", TransportMoney[playerid]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); GivePlayerCash(playerid, TransportMoney[playerid]); ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0; SetPlayerToTeamColor(playerid); return 1; } if(JobDuty[playerid] != 0) return SendClientMessageEx(playerid,COLOR_GREY," You need to get off duty with your mechanic/lawyer job first."); new newcar = GetPlayerVehicleID(playerid); if(IsAnTaxi(newcar)) { if(GetPlayerState(playerid) == 2 && PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17) { if(fare < 1 || fare > 500) { SendClientMessageEx(playerid, COLOR_GREY, " Fare price must be between $1 and $500!"); return 1; } TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = fare; format(string, sizeof(string), "You are now on-duty as Taxi Driver, fare: $%d.", TransportValue[playerid]); SendClientMessageEx(playerid, COLOR_WHITE, string); SetPlayerToTeamColor(playerid); } else { SendClientMessageEx(playerid, COLOR_GREY, " You are not the taxi driver!"); return 1; } } else if(IsAnBus(newcar) && PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17) { if(GetPlayerState(playerid) == 2) { if(fare < 1 || fare > 500) { SendClientMessageEx(playerid, COLOR_GREY, " Fare price must be between $1 and $500!"); return 1; } BusDrivers += 1; TransportDuty[playerid] = 2; TransportValue[playerid] = fare; format(string, sizeof(string), "You are now on-duty as Bus Driver, fare: $%d.", TransportValue[playerid]); SendClientMessageEx(playerid, COLOR_WHITE, string); SetPlayerToTeamColor(playerid); } else { SendClientMessageEx(playerid, COLOR_GREY, " You are not the taxi driver!"); return 1; } } else if (PlayerInfo[playerid][pTaxiLicense] == 1) { if(GetPlayerState(playerid) == 2) { if(fare < 1 || fare > 500) { SendClientMessageEx(playerid, COLOR_GREY, " Fare price must be between $1 and $500!"); return 1; } TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = fare; format(string, sizeof(string), "You are now on-duty as Taxi Driver, fare: $%d.", TransportValue[playerid]); SendClientMessageEx(playerid, COLOR_WHITE, string); SetPlayerToTeamColor(playerid); } else { SendClientMessageEx(playerid, COLOR_GREY, " You are not the taxi driver!"); return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "You're not in a taxi or a bus!"); } } else { SendClientMessageEx(playerid,COLOR_GREY,"You're not a licensed taxi/bus driver!"); return 1; } return 1; }
Код:
C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5474) : error 017: undefined symbol "SendClientMessageEx" C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5476) : error 017: undefined symbol "TransportDuty" C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5476) : warning 215: expression has no effect C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5476) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5476) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\My Documents\sv\gamemodes\SouthSideRP.pwn(5476) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Код:
new string[128], fare; if(sscanf(params, "d", fare)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fare [price]"); if(TransportDuty[playerid] > 0)
Thanks !