Posts: 913
Threads: 70
Joined: Apr 2009
Reputation:
0
How much RentCar value ?
OnPlayerEnterVehicle called, if you pressed Enter/F.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Can you post the part of the code where you define 'RentCars', please?
Posts: 3,488
Threads: 16
Joined: Jun 2007
Reputation:
0
You need to save your vehicleid's to variables.
Posts: 6,129
Threads: 36
Joined: Jan 2009
As I thought, RentCars is an array, you can't just compare it like that, plus I see nothing in your code where the actual vehicle ID is defined. Your code makes no absolutely sense. And I just want to add, this isn't a "stupid error", it's called proper scripting.
Quote:
Originally Posted by MadeMan
pawn Код:
IsRentCar(vehicleid) { for(new i=0; i < sizeof(RentCars); i++) { if(RentCars[i] == vehicleid) { return 1; } } return 0; }
Use this function and it should work.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (IsRentCar(vehicleid)) { GameTextForPlayer(playerid, "This Vehicle is For Rent, Type /rentcar to rent it", 3000, 4); } return 1; }
|
Did you bother looking at his 2d array?