14.06.2011, 15:39
So /rentcar working good but unrentcar not working i dont know why.
pawn Код:
/*------------------------------------------------------------------------------*/
CMD:rentcar(playerid,params[])
{
new
string[128];
if(RentaBike[playerid] == 0)
{
if(JB_GetPlayerMoney(playerid) < 30) { SCM(playerid,COLOR_GRAD4,"[Greska]: Nemas dovoljno novaca."); return 1; }
new hirefee = HireCost(GetPlayerVehicleID(playerid));
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
RentaBike[playerid] = 1;
JB_GivePlayerMoney(playerid,-250);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Unajmio si vozilo~n~koristi ~p~/lock",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
else
{
SCM(playerid,COLOR_GRAD4,"[Greska]: Vec imate rentano vozilo.");
}
return 1;
}
CMD:unrentcar(playerid,params[])
{
new veh;
veh = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
RentaBike[playerid] = 0;
HireCar[playerid] = 299;
SetVehicleToRespawn(veh);
GameTextForPlayer(playerid, "~w~Vise ne rentas auto.", 5000, 3);
}
}
return 1;
}