25.04.2012, 13:58
1st problem, so this is the function inside my /buycar command. This line is there:
which is supposed to get the maximum car ID in the server, and set it as "CarID". But in my scriptfiles, the "CarID" will be just: 0!
And If I buy a car, and I have more than 1 of this ^^ function with diffrent model ID's, its spamming me message: "Not enough money to buy it!" for 30 times (i have 30 of this function).
pawn Код:
dini_IntSet(fail, "CarID", i+1);
pawn Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(GetVehicleModel(vehicleid) == 491)
{
if(GetPlayerMoney(playerid) > 275000)
{
GivePlayerMoney(playerid, -275000);
SendClientMessageToAll(C_GREEN, string);
SendClientMessage(playerid, C_ORANGE, "SERVER: Your car was transported in front of the carshop!");
AddStaticVehicle(491, 2229.5801,58.1939,26.0340,179.0254,0,1);
dini_IntSet(fail, "CarModelID", 491);
dini_IntSet(fail, "CarID", i+1);
dini_FloatSet(fail, "CarX", 2229.5801);
dini_FloatSet(fail, "CarY", 58.1939);
dini_FloatSet(fail, "CarZ", 179.0254);
AutoInfo[vehicleid][aLocked] = 0;
}
else
{
SendClientMessage(playerid, C_RED, "SERVER: Not enough money to buy it!");
}
}