09.04.2015, 10:00
I made my rent system and everything works fine.
I just have a little problem:
"I rent vehicle than enter and left,and it says that i didn't rented that vehicle".
Here's @ONPLAYERSTATECHANGE:
You can see "if(Rentano[playerid] != 0)". I am using that to check if that vehicle is rented or not. But i would like to ignore it when is rented ? :=
I just have a little problem:
"I rent vehicle than enter and left,and it says that i didn't rented that vehicle".
Here's @ONPLAYERSTATECHANGE:
PHP код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new Vozilo = GetPlayerVehicleID(playerid);
{
if(newstate == PLAYER_STATE_DRIVER && Vozilo == Rent[0] || Vozilo == Rent[1] || Vozilo == Rent[2] || Vozilo == Rent[3] || Vozilo == Rent[4] || Vozilo == Rent[5] || Vozilo == Rent[6] || Vozilo == Rent[7])
{
if(Rentano[playerid] != 0) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Vozilo je vec iznajmljeno") && RemovePlayerFromVehicle(playerid);
{
ShowPlayerDialog(playerid,DIALOG_RENT,DIALOG_STYLE_LIST,""COLOR_ZUTA"Rent Vozila","{FFFFFF} ** "COLOR_SIVA"5 {FFFFFF}minuta\n** "COLOR_SIVA"15 {FFFFFF} minuta\n** "COLOR_SIVA"30 {FFFFFF} minuta","Iznajmi","Izlaz");
TogglePlayerControllable(playerid,0);
}
}
return 1;
}
}