Little random problem
#1

Код:
new Veh = random(sizeof(VehiclesNames));
sInfo[Vehicle] = VehiclesNames[Veh - MIN_VEH_ID];//7158

(7158) : error 006: must be assigned to an array
Whats wrong?
Reply
#2

Maybe you wanted to do it this way

pawn Код:
sInfo[Veh] = VehiclesNames[Veh - MIN_VEH_ID];//7158
Edit: Oops, no, I think the vehicle was correct

Edit 2: the problem is the [Veh - MIN_VEH_ID]. If the random returns e.g. 10, but MIN_VEH_ID is 20, it will result a negative value and crash the server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)