25.01.2011, 11:28
i'm with a bug on the /rentbike /rentcar (GM: LARP), when i type the command, Appear SERVER: Unknown Command, but the Bike/Car rent.
if(strcmp(cmd, "/alugarc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 9999999)
{
GameTextForPlayer(playerid, "~r~Acabou", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo tem tanto dinheiro !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar o carro/barco/aviгo para alugar isso !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Alguem ja alugou este carro !");
return 1;
}
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Nao esqueca de ~r~/desalugarcarro~n~~g~/trancar ~w~para trancar seu carro.",hirefee);
SendClientMessage(playerid, COLOR_YELLOW2, "Vocк pode ligar o motor agora!");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}
if(strcmp(cmd, "/alugarb", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[0][sbProducts] == 9999999)
{
GameTextForPlayer(playerid, "~r~Acabou", 5000, 1);
return 1;
}
/*if(PlayerInfo[playerid][pPbiskey] == 0)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
if (GetPlayerMoney(playerid) < SBizzInfo[0][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " Vocк nгo tem tanto dinheiro !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Vocк precisa desalugar o carro/barco/aviгo para alugar isso !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Alguem ja alugou este carro !");
return 1;
}
}
SafeGivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Nao esqueca de ~b~/desalugarb~n~~g~/trancar ~w~para trancar sua bike",hirefee);
TogglePlayerControllable(playerid, 1);
gEngine[GetPlayerVehicleID(playerid)] = 1;
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}