How to make, that only players with License can rent a car!?
#4

Ok straight up,

Every player needs a variable to store whether they have a license or not, it can be 0/1 or true/false that is up to you, which could go into as a new value with the players information enumeration.

At some point you need to give/take away the license, which is as simple as changing that value.

For renting a car, you obviously need to check the player enum[playerid][hasLicense] == 1 (they have a license), here is a mock example:

if (enum[playerid][hasLicense] == 1) { // You have a license. Give rental vehicle. }
else { // You do not have license, so no vehicle. }

enum/array or w/e being the name of what holds all the different properties for the player, [playerid] gives you a return number to access that array (so player[40][hasLicense] for example) and [hasLicense] is your newly add variable for storing and tracking if each user has a license or not.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)