License help..
#1

hii, I want if a player has these flags:

Код:
lflags |= ELicense_Drivers;
lflags |= ELicense_Trucker;
lflags |= ELicense_Fishing;
lflags |= ELicense_Sailing;
lflags |= ELicense_Flying;
and then attempts to take the license again.. just sendclientmessage that you alr have a license.

think it'll go somewhere here:
Код:
	case EGovDialog_DMVMenu: {
			if(!response) {
				return 0;
			}
			new ELicenseFlags:lflags = ELicenseFlags:GetPVarInt(playerid, "LicenseFlags");
			switch(listitem) {
				case 0: {
					if(GetMoneyEx(playerid) >= 1000) {
						SendToDrivingTest(playerid);
						GiveMoneyEx(playerid, -1000);
						return 1;
					} else {
						SendClientMessage(playerid, X11_TOMATO_2, "You do not have enough money");
					}
stop the player from getting into SendToDrivingTest if he has those flags..
Reply
#2

I suppose you know how this works since you're using bitflags, but essentially all you need to do is wrap it in another if-statement:
PHP код:
if(lflags ELicense_Drivers
Note: single ampersand.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
I suppose you know how this works since you're using bitflags, but essentially all you need to do is wrap it in another if-statement:
PHP код:
if(lflags ELicense_Drivers
Note: single ampersand.
Thanks, fixed
Код:
if(lflags & ELicense_Driving) return SendClientMessage(playerid, X11_TOMATO_2,"You already have a license.");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)