Insurance Points problem
#1

Hi,

I have a problem with buying insurance points.First when i start the server,i log in.And i type: "/cars" i select "Buy Insurance" and if i type "11"(points).I get a message that i can't get more then 10..all good.I get "10" points ,and when i try to buy again 1 point or more,i can't because i already have 10.After i destroy my vehicle,the vehicle points are now 9.Here is the problem,after i buy 10 points and destroy the car.I have 9 points,and if i try to buy 10 points.i can,10+10+10+10 how much times i want...
I tried to make it ,but i don't know how.I want that if you have example: "5"(points),you can't get more then 5 till the limit of 10/10.

Code: http://pastebin.com/gYUBfdJd
Reply
#2

Instead of:
if(vehicleVariables[id][vVehicleInsurancePoints] == 10)
Do:
if(vehicleVariables[id][vVehicleInsurancePoints] >= 10)
Would be my guess.
Reply
#3

No,still i can buy 10+10+10..etc After i destroy vehicle and have 9 points
Reply
#4

pawn Код:
new id = GetPlayerVehicleID(playerid);
                                        if(vehicleVariables[id][vVehicleInsurancePoints] == 10)
                                        {
                                                SendClientMessage(playerid,COLOR_GREY,"{FFB870}Nu mai poti cumpara puncte,deoarece ai deja 10.");
                                                return 1;
                                        }
                                        else
                                        {
                                               new da[500];
                                               format(da, 500, "Cate puncte de asigurare vrei sa cumperi? %d / insurance point     (%d/10)", vehicleVariables[playerid][vVehicleInsurancePrice],vehicleVariables[playerid][vVehicleInsurancePoints]);
                                               ShowPlayerDialog(playerid, 22521, DIALOG_STYLE_INPUT,"Insurance",da,"Ok","Cancel");
                                         }
Something like this?

And you have to do this also:

pawn Код:
else if(playerVariables[playerid][pCarSelected] == 2)
{
    if(points > 0)
    {
        new bani = vehicleVariables[playerid][vVehicleInsurancePrice2]*points;
        if(playerVariables[playerid][pMoney] > bani)
        {
            if(points + vehicleVariables[playerid][vVehicleInsurancePoints2] > 10) return SCM(playerid, -1,"text here");
            vehicleVariables[playerid][vVehicleInsurancePoints2] += points;
            playerVariables[playerid][pMoney] -= bani;
            format(szMessage,256,"Ai cumparat %d puncte de asigurare cu $%s.", points, NumberFormat(bani));
            SCM(playerid,COLOR_ATTACK, szMessage);
        }
        else SCM(playerid, -1,"You don't have enought money.");
    }
}
Reply
#5

Did you just copy it and paste?
Reply
#6

Quote:
Originally Posted by duteba
Посмотреть сообщение
Did you just copy it and paste?

No.. and look above.
Reply
#7

No,now i can't buy.I type "1" or "5" "10" but nothing.No message,no points ..0/10

P.S: Sorry didn't see the other code
Reply
#8

up! Someone else?maybe know help me pls?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)