Buylicense Dialog
#1

*FIXED
Reply
#2

Код:
if(PlayerInfo[playerid][pAge) < 18) return SendClientMessage(playerid,COLOR_RED,"You need to be 18+ to buy a license");
Reply
#3

pawn Код:
new pAge[MAX_PLAYERS];
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.
Reply
#4

Quote:
Originally Posted by Adil
pawn Код:
new pAge[MAX_PLAYERS];
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)