[Pomoć] Oko rent vozila..

Započeo Vegas., April 15, 2012, 11:21:38 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Vegas.

Skripta koju koristim: GF
Detaljan opis problema: Stavljao sam nova auta za rent kod spawna, sve sam dobro uradio ali ta auta svako može voziti... Ne vidim problem.. Ne shvatam kako ovo da uradim...
Dio skripte:
if(dialogid == 320)
	{
		if(response)
		{
	      if(GetPlayerVehicleID(playerid) >= 139 && GetPlayerVehicleID(playerid) <= 152) && GetPlayerVehicleID(playerid) >= 460 && GetPlayerVehicleID(playerid) <= 462) // OVO
			{
				if(SBizzInfo[0][sbProducts] == 0)
				{
					GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 4000, 4);
					return 1;
				}
				if (GetPlayerMoney(playerid) <  199)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   Nemate dovoljno novca !");
					return 1;
				}
				if(HireCar[playerid] != 299)
				{
					gCarLock[HireCar[playerid]] = 0;
					UnLockCar(HireCar[playerid]);
					SendClientMessage(playerid, COLOR_GREY, "Morate prvo da vratite iznajmljeni auto/motor/biciklo  !");
					return 1;
				}
				foreach (Player, i)
				{
				    if(HireCar[i] == GetPlayerVehicleID(playerid))
				    {
				        SendClientMessage(playerid, COLOR_GREY, "    Neko je vec iznajmio ovo vozilo !");
				        return 1;
				    }
				}
				SafeJBC_GivePlayerMoney(playerid,-200);
				SBizzInfo[0][sbTill] += 200;
				ExtortionSBiz(0, 200);
				SBizzInfo[0][sbProducts]--;
				HireCar[playerid] = GetPlayerVehicleID(playerid);
				OnPropUpdate();
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Da vratite vozilo kucajte /unrent !");
				TogglePlayerControllable(playerid, 1);
				gEngine[GetPlayerVehicleID(playerid)] = 1;
			}
		}
		return 1;
	}


Evo errora
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : warning 215: expression has no effect
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Poslednja Izmena: April 15, 2012, 11:50:17 PRE PODNE od Vegas.

Dali si stavio kada sjedne na motor/auto da ga freeza dok ne renta automobil
I najveci talenti gube se u neradu, zato nemoj trazit izgovor da neznas nego naÄ'i rjesenje!




Vegas.

Citat: ||¤ Johnny ¤|| poslato April 15, 2012, 11:26:43 PRE PODNE
Dali si stavio kada sjedne na motor/auto da ga freeza dok ne renta automobil
Jao kako bi te razvalio, aj mrš iz teme spameru !

Možeš dati koja je točna linija?

Vegas.

Citat: [SX] R3DM4N poslato April 15, 2012, 11:49:14 PRE PODNE
Možeš dati koja je točna linija?
Stavio sam gore...
if(GetPlayerVehicleID(playerid) >= 139 && GetPlayerVehicleID(playerid) <= 152) && GetPlayerVehicleID(playerid) >= 460 && GetPlayerVehicleID(playerid) <= 462) // OVO

if(GetPlayerVehicleID(playerid) >= 139 && GetPlayerVehicleID(playerid) <= 152) && GetPlayerVehicleID(playerid) >= 460 && GetPlayerVehicleID(playerid) <= 462); // OVO


Stavi ovako, jer si zaboravio  ;        :D

http://wiki.sa-mp.com/wiki/GetPlayerVehicleID

Vegas.

Citat: [SX] R3DM4N poslato April 15, 2012, 11:54:07 PRE PODNE
if(GetPlayerVehicleID(playerid) >= 139 && GetPlayerVehicleID(playerid) <= 152) && GetPlayerVehicleID(playerid) >= 460 && GetPlayerVehicleID(playerid) <= 462); // OVO


Stavi ovako, jer si zaboravio  ;        :D

http://wiki.sa-mp.com/wiki/GetPlayerVehicleID
Ma nije to,
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : warning 215: expression has no effect
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Vegas\Desktop\dv rp\gamemodes\division.pwn(20838) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase

Prepravi tu liniju u ovo:
if(GetPlayerVehicleID(playerid) >= 139 && GetPlayerVehicleID(playerid) <= 152 && GetPlayerVehicleID(playerid) >= 460 && GetPlayerVehicleID(playerid) <= 462)

Last nick: Paradox

Vegas.

Radi hvala, ali se meni opet ništa ne prikazuje na tim autima za rent što sam dodao... Može ih voziti ko hoće..

Pa ti si to stavio pod OnDialogResponse callback, a trebalo bi pod OnPlayerEnterVehicle ili OnPlayerStateChange callback.

Last nick: Paradox

Vegas.

Stavio sam znači OnDialogResponse, OnPlayerStateChange, ali neam ideju kako to napraviti na OnPlayerEnterVehicle...