SA-MP Forums Archive
Cars - 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: Cars (/showthread.php?tid=311768)



Cars - Brka - 18.01.2012

Can someone help me make the car buying levels.If player level is 5 can only buy оne car, if player level is 10 can buy two cars, if player level is 15 can buy three cars?

Tnx, and sorry for my bad English


Re: Cars - mineralo - 18.01.2012

make something like PlayerInfo
and when make the cmd to buy post your condition, I show you small example
pawn Код:
enum pooInfo
{
    pLevel,
};
new PlayerInfo[MAX_PLAYERS][pooInfo];

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/buy", true) == 0)
    {
        if(PlayerInfo[playerid][pLevel] =>5)
        {
            balabla
            }
        return 1;
        }
return 0;
}



Re: Cars - Brka - 18.01.2012

buy how i make if player level is 10 can buy only 2 cars?


Re: Cars - mineralo - 18.01.2012

you need a cars' system
and about lvl 10
pawn Код:
enum pooInfo
{
    pLevel,
};
new PlayerInfo[MAX_PLAYERS][pooInfo];

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/buy", true) == 0)
    {
        if(PlayerInfo[playerid][pLevel] =>5 && PlayerInfo[playerid][pLevel] <=9)
        {
            balabla
            }
else if(PlayerInfo[playerid][pLevel] =>10)
{
balbal
}
        return 1;
        }
return 0;
}