25.06.2015, 15:17
Hi There , im new at this forum and i dont think that ive ever posted somewhere on any forum and here we go i have a Error that i didnt Found a Solution to Fix it

the story is , i found a Vehicle system that works but when someone enters someother vehicles it says that the Vehicle is owned by XXXX ...
the problem is that the player still can Drive it and its not his Vehicle so ive added a simple thing that see's if the vehicleOwner[id] == playername and i get this error
the error is :
and i will show you the part where is the error in
any help Guys


the story is , i found a Vehicle system that works but when someone enters someother vehicles it says that the Vehicle is owned by XXXX ...
the problem is that the player still can Drive it and its not his Vehicle so ive added a simple thing that see's if the vehicleOwner[id] == playername and i get this error
the error is :
Code:
C:/Path/avs.pwn(1940) : error 033: array must be indexed (variable "VehicleOwner")
Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if(!ispassenger) { new id = GetVehicleID(vehicleid); if(IsValidVehicle(id) && VehicleCreated[id] == VEHICLE_PLAYER) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(VehicleOwner[id] == name){ SendClientMessage(playerid,COLOR_GREEN,"This is your Vehicle :D"); } new msg[128]; format(msg, sizeof(msg), "This vehicle belongs to %s so you cannot Use it , buy one -_- ", VehicleOwner[id]); SendClientMessage(playerid, COLOR_GREY, msg); RemovePlayerFromVehicle(playerid); } } return 1; }

