Taxi Command
#1

CMD:taxi(playerid, params[])
{
new string[128];
new option[11], secoption, vehicle = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 10|| PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pTaxiLicense] == 1)
{
if(sscanf(params,"s[32]I(65535)", option, secoption))
{
SendClientMessage(playerid,-1, "/taxi [Options]");
SendClientMessage(playerid, COLOR_GREY, "Options: | duty | start | stop | fare | accept |");
return 1;
}
if(CompareStrings(option, "duty"))
{
if(IsADriver(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a Taxi/Cabbie as a driver.");
if(IsATaxi(vehicle)) return SendClientMessage(playerid, COLOR_RED, "You must be inside a Taxi/Cabbie.");
if(TaxiDuty{playerid})
{
SendClientMessage(playerid, COLOR_YELLOW, "[TAXI]: You are now OFF duty taxi and won't recieve calls.");
SetPlayerToTeamColor(playerid);
TaxiDuty{playerid} = false;
TaxiMade[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "[TAXI]: You are now ON duty taxi and will recieve calls.");
SetPlayerToTeamColor(playerid);
TaxiDuty{playerid} = true;
TaxiMade[playerid] = 0;
}
}
if(CompareStrings(option, "start"))
{
if(!IsDriver(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a Taxi/Cabbie as a driver.");
if(!IsATaxi(vehicle)) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(!TaxiDuty{playerid}) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(TaxiFare{playerid} == 0) return SendClientMessage(playerid, COLOR_GREY, "You haven't set a fare yet, /taxi fare ($1-$25)");
if(TaxiStart{playerid}) return SendClientMessage(playerid, COLOR_GREY, "Your taxi fare has already started.");
SendClientMessage(playerid, COLOR_YELLOW, "[TAXI]: Your taxi fare has started and charging all people inside your vehicle.");
TaxiStart{playerid} = true;
}
if(CompareStrings(option, "fare"))
{
new fare;
if(!IsDriver(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a Taxi/Cabbie as a driver.");
if(!IsATaxi(vehicle)) return SendClientMessage(playerid, COLOR_RED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params, "d",fare)) return SendClientMessageEx(playerid, COLOR_WHITE, "/taxi fare [amount]");
if(!TaxiDuty{playerid}) return SendClientMessageEx(playerid, COLOR_GREY, "You are not on duty.");
if(fare < 1 || fare > 25) return SendClientMessage(playerid, COLOR_GREY, "There is a limit for taxi fare, ($1-$25).");
format(string, sizeof(string), "[TAXI]: You have changed your taxi fare to $%d.", fare);
SendClientMessage(playerid, COLOR_YELLOW, string);
TaxiFare{playerid} = fare;
}
if(CompareStrings(option, "accept"))
{
new id;
if(!IsDriver(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a Taxi/Cabbie as a driver.");
if(!IsATaxi(vehicle)) return SendClientMessage(playerid, COLOR_RED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"i",id)) return SendClientMessageEx(playerid, COLOR_WHITE, "/taxi accept [playerid]");
if(!TaxiDuty{playerid}) return SendClientMessageEx(playerid, COLOR_GREY, "You are not on duty.");
if(!IsPlayerConnected(id)) return Error(playerid, "That player is not connected");
if(GetPVarInt(id, "NeedTaxi") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "This player hasn't requested any taxi.");
format(string, sizeof(string), "* %s has accepted your taxi call, he charges %d per second!", GetPlayerNameEx(playerid), TaxiFare{playerid});
SendClientMessage(id, COLOR_YELLOW, string);
format(string, sizeof(string), "* You have accepted %s taxi call.", GetPlayerNameEx(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
if(CompareStrings(option, "stop"))
{
if(!IsDriver(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside a Taxi/Cabbie as a driver.");
if(!IsATaxi(vehicle)) return SendClientMessage(playerid, COLOR_RED, "You must be inside a Taxi/Cabbie.");
if(!TaxiDuty{playerid}) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(!TaxiStart{playerid}) return SendClientMessage(playerid, COLOR_GREY, "Your taxi fare is not started.");
SendClientMessage(playerid, COLOR_YELLOW, "[TAXI]: Your taxi fare has stopped and charges all people inside.");
format(string, sizeof(string), "[TAXI]: The final fare of your taxi has reached to, $%d.", TaxiMade[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
foreach(Player, i)
{
if(PlayerInCar(i) && GetPlayerState(i) != PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
ChargePerson(i);
}
}
TaxiStart{playerid} = false;
TaxiMade[playerid] = 0;
}
}
else
{
SendClientMessageEx(playerid,COLOR_GREY,"You're not a licensed taxi/bus driver!");
return 1;
}
return 1;
}


Not working
error:

C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(794) : error 017: undefined symbol "pMember"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(802) : error 017: undefined symbol "CompareStrings"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(804) : error 017: undefined symbol "IsADriver"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(805) : error 017: undefined symbol "IsATaxi"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : error 017: undefined symbol "TaxiDuty"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : warning 215: expression has no effect
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : error 001: expected token: ";", but found "}"
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : warning 217: loose indentation
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : error 029: invalid expression, assumed zero
C:\Users\Gamer\Desktop\good - Copy\gamemodes\Millenium.pwn(806) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


8 Errors.
Reply
#2

The first few mean you have to define pMember, CompareStrings, IsADriver, IsATaxi, TaxiDuty... Was this copy/pasted from somewhere by an chance?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)