Taxi System -
FaZeRs - 24.02.2014
So i am trying to add some realistic taxi system to my server but i have some errors
ERRORS
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130417) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130433) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130434) : error 017: undefined symbol "GetName"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130435) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130437) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130438) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130447) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130454) : error 017: undefined symbol "COLOR_YELLOWG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130455) : error 017: undefined symbol "GiveCash"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130456) : error 017: undefined symbol "GiveCash"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130466) : error 017: undefined symbol "PlayerIsOn"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130468) : error 017: undefined symbol "IsDriver"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130481) : warning 235: public function lacks forward declaration (symbol "IsATaxi")
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130493) : error 017: undefined symbol "i"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130493) : error 017: undefined symbol "SCM"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130496) : error 017: undefined symbol "SyntaxMSG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130502) : error 017: undefined symbol "IsDriver"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130506) : error 017: undefined symbol "COLOR_YELLOWG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130507) : error 017: undefined symbol "SetNormalColor"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130513) : error 017: undefined symbol "COLOR_YELLOWG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130514) : error 017: undefined symbol "TAXI_DUTY"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130521) : error 017: undefined symbol "IsDriver"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130526) : error 017: undefined symbol "COLOR_YELLOWG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130532) : error 017: undefined symbol "IsDriver"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130534) : error 017: undefined symbol "SyntaxMSG"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130537) : error 017: undefined symbol "msg"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130537) : error 017: undefined symbol "msg"
Code
PHP код:
//===========================Taxi System by Jack Robertson============================//
stock MessageJob(job, color, message[], bool:checkduty)
{
foreach(Player, i)
{
if(PlayerInfo[i][pJob] == job || PlayerInfo[i][pJob2] == job)
{
if(checkduty == true)
{
if(PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17)
{
SendClientMessage(i, color, message);
}
}
else
{
SendClientMessage(i, color, message);
}
}
}
return 1;
}
stock SendTaxiRequest(playerid, location[])
{
new string[128];
MessageJob(TAXI, COLOR_YELLOWG, "|_________Taxi Call_________|",true);
format(string, sizeof(string), "Caller: %s Ph: %d", GetPlayerNameEx(playerid), PlayerInfo[playerid][pPnumber]);
MessageJob(TAXI, COLOR_YELLOWG, string, true);
format(string, sizeof(string), "Location: %s", location);
MessageJob(TAXI, COLOR_YELLOWG, string, true);
MessageJob(TAXI, COLOR_YELLOWG, "** /taxi accept ID to take this mission! **", true);
return 1;
}
stock ChargePerson(playerid)
{
new string[128];
if(GetPlayerMoney(playerid) < TaxiMoney[playerid])
{
SendClientMessageEx(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, "%s doesn't have enough money to pay for the TAXI.", GetPlayerNameEx(playerid));
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
else
{
format(string, sizeof(string), "[TAXI]: The final taxi fare has got to, $%d.", TaxiMoney[playerid]);
SendClientMessage(playerid, COLOR_YELLOWG, string);
GiveCash(playerid, -TaxiMoney[playerid]);
GiveCash(GetVehicleDriver(OldVehicle[playerid]), TaxiMoney[playerid]);
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
}
stock GetVehicleDriver(vehicle)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerIsOn(i))
{
if(IsDriver(i) && GetPlayerVehicleID(i) == vehicle)
return i;
}
}
return INVALID_PLAYER_ID;
}
stock ShowJobMessage(playerid, message[])
{
ShowTextDraw(playerid, TruckerDraw[playerid]);
TextDrawSetString(TruckerDraw[playerid], message);
return 1;
}
public IsATaxi(vehicle)
{
new model = GetVehicleModel(vehicle);
if(model == 420 || model == 438)
{
return 1;
}
return 0;
}
CMD:taxi(playerid, params[])
{
new option[11], secoption, vehicle = GetPlayerVehicleID(playerid);
if(TransportDuty[i] > 0 && (PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17 || PlayerInfo[i][pTaxiLicense] == 1 )) return SCM(playerid, COLOR_WHITE, "You are not a taxi driver.");
if(sscanf(params,"s[11]D(-1)", option, secoption))
{
SyntaxMSG(playerid, "/taxi [option]");
SendClientMessage(playerid, COLOR_GREY, "Options: | duty | start | stop | fare | accept |");
return 1;
}
if(CompareStrings(option, "duty"))
{
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})
{
SendClientMessage(playerid, COLOR_YELLOWG, "[TAXI]: You are now OFF duty taxi and won't recieve calls.");
SetNormalColor(playerid);
TaxiDuty{playerid} = false;
TaxiMade[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_YELLOWG, "[TAXI]: You are now ON duty taxi and will recieve calls.");
SetPlayerColor(playerid, TAXI_DUTY);
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_YELLOWG, "[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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"{s[11]}d",fare)) return SyntaxMSG(playerid, "/taxi fare [amount]");
if(!TaxiDuty{playerid}) return SendClientMessage(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(msg, sizeof(msg), "[TAXI]: You have changed your taxi fare to $%d.", fare);
SendClientMessage(playerid, COLOR_YELLOWG, msg);
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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"{s[11]}d",id)) return SyntaxMSG(playerid, "/taxi accept [playerid]");
if(!TaxiDuty{playerid}) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
if(GetIntVar(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!", GetNameEx(playerid), TaxiFare{playerid});
SendClientMessage(id, COLOR_YELLOWG, string);
format(string, sizeof(string), "* You have accepted %s taxi call.", GetNameEx(id));
SendClientMessage(playerid, COLOR_YELLOWG, 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_LIGHTRED, "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_YELLOWG, "[TAXI]: Your taxi fare has stopped and charges all people inside.");
format(mstring, sizeof(string), "[TAXI]: The final fare of your taxi has reached to, $%d.", TaxiMade[playerid]);
SendClientMessage(playerid, COLOR_YELLOWG, string);
foreach(Player, i)
{
if(PlayerInCar(i) && GetPlayerState(i) != PLAYER_STATE_DRIVER && GetPlayerVehicleID(i) == GetPlayerVehicleID(playerid))
{
ChargePerson(i);
}
}
TaxiStart{playerid} = false;
TaxiMade[playerid] = 0;
}
return 1;
}
Re: Taxi System -
Aerotactics - 24.02.2014
Where's your defines?
Re: Taxi System -
FaZeRs - 24.02.2014
I fixed some errors now i get
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130434) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130436) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130438) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130439) : error 017: undefined symbol "TAXI"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130448) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130505) : error 017: undefined symbol "i"
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130508) : error 035: argument type mismatch (argument 2)
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130546) : error 035: argument type mismatch (argument 2)
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130558) : error 035: argument type mismatch (argument 2)
Code
PHP код:
stock MessageJob(job, color, message[], bool:checkduty)
{
foreach(Player, i)
{
if(PlayerInfo[i][pJob] == job || PlayerInfo[i][pJob2] == job)
{
if(checkduty == true)
{
if(PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17)
{
SendClientMessage(i, color, message);
}
}
else
{
SendClientMessage(i, color, message);
}
}
}
return 1;
}
stock SendTaxiRequest(playerid, location[])
{
new string[128];
MessageJob(TAXI, COLOR_YELLOW, "|_________Taxi Call_________|",true); // Error here
format(string, sizeof(string), "Caller: %s Ph: %d", GetPlayerNameEx(playerid), PlayerInfo[playerid][pPnumber]);
MessageJob(TAXI, COLOR_YELLOW, string, true); // Error Here
format(string, sizeof(string), "Location: %s", location);
MessageJob(TAXI, COLOR_YELLOW, string, true); // Error Here
MessageJob(TAXI, COLOR_YELLOW, "** /taxi accept ID to take this mission! **", true); // Error Here
return 1;
}
stock ChargePerson(playerid)
{
new string[128];
if(GetPlayerMoney(playerid) < TaxiMoney[playerid])
{
SendClientMessageEx(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, "%s doesn't have enough money to pay for the TAXI.", GetPlayerNameEx(playerid)); // Error here
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
else
{
format(string, sizeof(string), "[TAXI]: The final taxi fare has got to, $%d.", TaxiMoney[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
GivePlayerCash(playerid, -TaxiMoney[playerid]);
GivePlayerCash(GetVehicleDriver(OldVehicle[playerid]), TaxiMoney[playerid]);
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
}
stock GetVehicleDriver(vehicle)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsDriver(i) && GetPlayerVehicleID(i) == vehicle)
return i;
}
}
return INVALID_PLAYER_ID;
}
stock ShowJobMessage(playerid, message[])
{
ShowTextDraw(playerid, TruckerDraw[playerid]);
TextDrawSetString(TruckerDraw[playerid], message);
return 1;
}
forward IsATaxi(vehicle);
public IsATaxi(vehicle)
{
new model = GetVehicleModel(vehicle);
if(model == 420 || model == 438)
{
return 1;
}
return 0;
}
stock IsDriver(playerid)
{
if(PlayerInCar(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
return true;
else
return false;
}
CMD:taxi(playerid, params[])
{
new string[128];
new option[11], secoption, vehicle = GetPlayerVehicleID(playerid);
if(TransportDuty[i] > 0 && (PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17 || PlayerInfo[i][pTaxiLicense] == 1 )) return SendClientMessage(playerid, COLOR_WHITE, "You are not a taxi driver.");
if(sscanf(params,"s[11]D(-1)", option, secoption))
{
SendClientMessageEx(playerid, "/taxi [option]");
SendClientMessageEx(playerid, COLOR_GREY, "Options: | duty | start | stop | fare | accept |");
return 1;
}
if(CompareStrings(option, "duty"))
{
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})
{
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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"{s[11]}d",fare)) return SendClientMessageEx(playerid, "/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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"{s[11]}d",id)) return SendClientMessageEx(playerid, "/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_LIGHTRED, "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;
}
return 1;
}
Re: Taxi System -
Aerotactics - 24.02.2014
ForEach is written:
As for your other errors, you still need to define "TAXI"
Off-topic: Am I the only one that would go crazy typing 130,000 lines of code?
Re: Taxi System -
FaZeRs - 24.02.2014
Alright, now i got some other errors
Errors:
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130510) : error 035: argument type mismatch (argument 2)
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130548) : error 035: argument type mismatch (argument 2)
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130560) : error 035: argument type mismatch (argument 2)
Code
PHP код:
CMD:taxi(playerid, params[])
{
new string[128];
new option[11], secoption, vehicle = GetPlayerVehicleID(playerid);
if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10|| PlayerInfo[playerid][pJob] == 17 || PlayerInfo[playerid][pJob2] == 17 || PlayerInfo[playerid][pTaxiLicense] == 1)
{
if(sscanf(params,"s[32]", option, secoption))
{
SendClientMessage(playerid, "/taxi [option]"); // Error here
SendClientMessageEx(playerid, COLOR_GREY, "Options: | duty | start | stop | fare | accept |");
return 1;
}
if(CompareStrings(option, "duty"))
{
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})
{
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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"d",fare)) return SendClientMessage(playerid, "/taxi fare [amount]"); // Error here
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_LIGHTRED, "You must be inside a Taxi/Cabbie.");
if(sscanf(params,"i",id)) return SendClientMessage(playerid, "/taxi accept [playerid]"); // Error here
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_LIGHTRED, "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;
}
Error:
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130449) : warning 202: number of arguments does not match definition
Code:
PHP код:
stock IsDriver(playerid)
{
if(PlayerInCar(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
return true;
else
return false; // Error hwew
}
And i get other error
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(14871) : error 025: function heading differs from prototype
Code
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
I know bodyparts is for 0.3z but i have already 0.3z
Re: Taxi System -
DarkLored - 25.02.2014
You need to update YSI to make the bodyparts work for 0.3z i had the same problem and its fixed
and here is a quick fix for your first error that you got
pawn Код:
if(sscanf(params,"s[32]", option, secoption))
{
SendClientMessage(playerid,-1, "/taxi [option]"); // Error here
SendClientMessageEx(playerid, COLOR_GREY, "Options: | duty | start | stop | fare | accept |");
return 1;
}
Re: Taxi System -
FaZeRs - 25.02.2014
Still some errors
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130479) : warning 202: number of arguments does not match definition
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130578) : error 035: argument type mismatch (argument 2)
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130590) : error 035: argument type mismatch (argument 2)
PHP код:
//First one
SendClientMessage(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, "%s doesn't have enough money to pay for the TAXI.", GetPlayerNameEx(playerid));
//Second One
if(sscanf(params,"d",fare)) return SendClientMessage(playerid, "/taxi fare [amount]");
//Third One
if(sscanf(params,"i",id)) return SendClientMessage(playerid, "/taxi accept [playerid]");
Re: Taxi System -
FaZeRs - 25.02.2014
Fixed all errors got only this
PHP код:
C:\Users\Euronics Latvija\Desktop\MYSERVER\gamemodes\clrp.pwn(130491) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 43280 bytes
Code size: 7835400 bytes
Data size: 66355380 bytes
Stack/heap size: 16000000 bytes; estimated max. usage: unknown, due to recursion
Total requirements:90234060 bytes
1 Warning.
Code
PHP код:
stock ChargePerson(playerid)
{
new string[128];
if(GetPlayerMoney(playerid) < TaxiMoney[playerid])
{
SendClientMessage(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, "%s doesn't have enough money to pay for the TAXI.",GetPlayerNameEx(playerid)); //This line shows warning
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
else
{
format(string, sizeof(string), "[TAXI]: The final taxi fare has got to, $%d.", TaxiMoney[playerid]);
SendClientMessage(playerid, COLOR_YELLOW, string);
GivePlayerCash(playerid, -TaxiMoney[playerid]);
GivePlayerCash(GetVehicleDriver(OldVehicle[playerid]), TaxiMoney[playerid]);
TaxiMade[GetVehicleDriver(OldVehicle[playerid])] -= TaxiMoney[playerid];
TaxiMoney[playerid] = 0;
}
}
Re: Taxi System -
Aerotactics - 25.02.2014
SendClientMessage only uses 3 parameters, you'll need to use "format" to create a string to replace your text.
This:
pawn Код:
SendClientMessage(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, "%s doesn't have enough money to pay for the TAXI.",GetPlayerNameEx(playerid));
turns into this:
pawn Код:
new string[128];
format(string,sizeof(string),"%s doesn't have enough money to pay for the TAXI.",GetPlayerNameEx(playerid));
SendClientMessage(GetVehicleDriver(OldVehicle[playerid]), COLOR_WHITE, string);
Sources:
https://sampwiki.blast.hk/wiki/SendClientMessage
https://sampwiki.blast.hk/wiki/Format
Re: Taxi System -
FaZeRs - 25.02.2014
DELTED .....