PDA

View Full Version : Insurance Points problem


duteba
08/03/2015, 07:35 PM
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

oliverrud
08/03/2015, 08:38 PM
Instead of:
if(vehicleVariables[id][vVehicleInsurancePoints] == 10)
Do:
if(vehicleVariables[id][vVehicleInsurancePoints] >= 10)
Would be my guess.

duteba
08/03/2015, 09:01 PM
No,still i can buy 10+10+10..etc After i destroy vehicle and have 9 points

finelaq
08/03/2015, 09:07 PM
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:


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.");
}
}

duteba
08/03/2015, 09:09 PM
Did you just copy it and paste?

finelaq
08/03/2015, 09:18 PM
Did you just copy it and paste?
http://forums.nba-live.com/images/smilies/icon_facepalm.gif
No.. and look above.

duteba
08/03/2015, 09:31 PM
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

duteba
09/03/2015, 06:18 PM
up! Someone else?maybe know help me pls?