20.11.2015, 16:14
(
Последний раз редактировалось MayaEU; 20.11.2015 в 16:30.
Причина: Editing Thread
)
Hi, this is my /buyinsurance command, its used for my vehicle system.. But when i type /buyinsurance, it says that i have bought Insurances, but it will not add the Insurances to the car system.. 

pawn Код:
if(strcmp(cmd, "/buyinsurance", true) == 0 || strcmp(cmd, "/buyinsurances", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid,2.0,1529.6,-1691.2,13.3))
{
SendClientMessage(playerid, COLOR_GREY, "You can not buy insurance here.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, ""COL_SZR"Usage:"COL_WHITE" /buyinsurance [amount]");
return 1;
}
new amount = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, ""COL_SZR"Usage:"COL_WHITE" /buyinsurance [amount]");
return 1;
}
//for(new i=0; i<MAX_VEHICLES; i++)
for(new i = 0; i < sizeof(CarInfo); i++)
{
VehSpawned[CarInfo[i][cInsurances]] += amount;
CarInfo[VehSpawned[i]][cInsurances] += amount;
CarInfo[i][cInsurances] += amount;
format(string, sizeof(string), "You have purchased %d insurances.", amount);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
}
return 0;
}

