License help.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: License help.. (
/showthread.php?tid=640292)
License help.. -
Puff - 31.08.2017
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..
Re: License help.. -
Vince - 31.08.2017
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.
Re: License help.. -
Puff - 01.09.2017
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.");