28.06.2014, 21:10
Well...Whenever the taxi driver does /accepttaxi it keeps saying that he isn't a taxi driver...I Don't know why actually i've tried over and over to fix it but still --_--
The CMD:
The CMD:
pawn Код:
CMD:accepttaxi(playerid, params[])
{
if(PlayerInfo[playerid][pJob] != 17 || PlayerInfo[playerid][pJob2] != 17 || PlayerInfo[playerid][pMember] != 10 || PlayerInfo[playerid][pLeader] != 10) {
SendClientMessageEx(playerid, COLOR_GREY, " You are not a taxi driver!");
}
else {
new
szMessage[128],
iTarget;
if(sscanf(params, "i", iTarget)) {
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /accepttaxi[playerid]");
}
else if(!IsPlayerConnected(iTarget)) {
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
}
else if(iTarget == playerid) {
SendClientMessageEx(playerid, COLOR_GREY, "You can't accept your own service call.");
}
else if(!GetPVarType(iTarget, "TaxiCaller")) {
SendClientMessageEx(playerid, COLOR_GREY, "That person has not called for a service.");
}
else {
format(szMessage, sizeof(szMessage), "** Taxi Driver %s has accepted the service call from %s(%d)" , GetPlayerNameEx(playerid), GetPlayerNameEx(iTarget), iTarget);
SendJobMessage(17, COLOR_YELLOW, szMessage);
foreach(Player, i)
{
if(PlayerInfo[i][pJob] == 17 || PlayerInfo[i][pJob2] == 17)
{
SendClientMessageEx(i, COLOR_YELLOW, szMessage);
}
}
format(szMessage, sizeof(szMessage), "* Taxi driver %s has accepted your service call with fare %d; please wait at your current position.",GetPlayerNameEx(playerid), TransportValue[playerid]);
SendClientMessageEx(iTarget, COLOR_LIGHTBLUE, szMessage);
GameTextForPlayer(playerid, "~w~Taxi Caller~n~~r~Go to the red marker.", 5000, 1);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_TAXICALL;
TaxiAccepted[playerid] = iTarget;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(iTarget, X, Y, Z);
SetPlayerCheckpoint(playerid, X, Y, Z, 5);
DeletePVar(iTarget, "TaxiCaller");
}
}
return 1;
}