06.07.2016, 17:12
So i have this rent system and i have problem. I made rent for cars and it works great. But when i add motorbikes it gets buggy.
When i add this
As soon as i spawn it shows me that GameTextForPlayer and when i enter car it says that i can rent bike o.O. It only happens when i write that GameTextForPlayer for bikes.Any ideas??
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vozilo = GetPlayerVehicleID(playerid);
if(RentAuta(vozilo))
{
if(Rentano[playerid] != vozilo)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~w~Mozete rentati ovo vozilo ~b~/rent ~w~ili ~b~/izlaz~n~~w~Cena Renta: ~g~300$",5000,3);
}
}
else if(RentMotor(vozilo))
{
if(Rentano[playerid] != vozilo)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~w~Mozete rentati ovaj motor ~b~/rent ~w~ili ~b~/izlaz~n~~w~Cena Renta: ~g~80$",5000,3);
}
}
return 1;
}
stock RentAuta(carid)
{
for(new i = 0; i < sizeof(rentauta); i++)
{
if(carid == rentauta[i]) return 1;
}
return 0;
}
////////////////////////////////////////////////////////////////////////////////
stock RentMotor(carid)
{
for(new i = 0; i < sizeof(rentmotor); i++)
{
if(carid == rentmotor[i]) return 1;
}
return 1;
}
PHP код:
else if(RentMotor(vozilo))
{
if(Rentano[playerid] != vozilo)
{
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~w~Mozete rentati ovaj motor ~b~/rent ~w~ili ~b~/izlaz~n~~w~Cena Renta: ~g~80$",5000,3);
}
}