Buylicense Dialog - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Buylicense Dialog (
/showthread.php?tid=142831)
Buylicense Dialog -
sjvt - 20.04.2010
*FIXED
Re: Buylicense Dialog -
DarrenReeder - 20.04.2010
Код:
if(PlayerInfo[playerid][pAge) < 18) return SendClientMessage(playerid,COLOR_RED,"You need to be 18+ to buy a license");
Re: Buylicense Dialog -
Adil - 20.04.2010
pawn Код:
if(listitem == 2)
{
if(pAge[playerid] < 18)
{
SendClientMessage(playerid,0xFFFFFFFF,"You need to be atleast 18 years old to buy a car license.");
}
if(playermoney >= 3000)
{
PlayerInfo[playerid][pLicenseC] = 1;
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, COLOR_YELLOW,"You have successfully bought a Car license for $10000,- dollars.");
}
else
{
SendClientMessage(playerid, COLOR_RED,"You need $3000,- dollars in cash to buy a Car license.");
}
}
NOTE: I did not set the age anywhere in here because i didn't knew where should your player's Age needs to be set, so you must set the age by yourself.
Re: Buylicense Dialog -
DarrenReeder - 20.04.2010
Quote:
Originally Posted by Adil
pawn Код:
if(listitem == 2) { if(pAge[playerid] < 18) { SendClientMessage(playerid,0xFFFFFFFF,"You need to be atleast 18 years old to buy a car license."); } if(playermoney >= 3000) { PlayerInfo[playerid][pLicenseC] = 1; GivePlayerMoney(playerid, -10000); SendClientMessage(playerid, COLOR_YELLOW,"You have successfully bought a Car license for $10000,- dollars."); } else { SendClientMessage(playerid, COLOR_RED,"You need $3000,- dollars in cash to buy a Car license."); } }
NOTE: I did not set the age anywhere in here because i didn't knew where should your player's Age needs to be set, so you must set the age by yourself.
|
This will not work, you forgot to return:
Код:
if(pAge[playerid] < 18)
{
SendClientMessage(playerid,0xFFFFFFFF,"You need to be atleast 18 years old to buy a car license.");
return 1;
}