CMD:addcar(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin]<8)return false;
new string[650];
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid,-1,"Вы не в машине.");
new idcar, house_price;
new Float:X, Float:Y, Float:Z, Float:A;
if(sscanf(params, "ii",idcar,house_price))
{
SendClientMessage(playerid, -1, "Используйте: /addcar [id car] [цена продажи]");
return 1;
}
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,A);
CarInfo[OWNABLECARS][cSell_X]=X;
CarInfo[OWNABLECARS][cSell_Y]=Y;
CarInfo[OWNABLECARS][cSell_Z]=Z;
CarInfo[OWNABLECARS][cSell_A]=A;
CarInfo[OWNABLECARS][cPos_X]=X;
CarInfo[OWNABLECARS][cPos_Y]=Y;
CarInfo[OWNABLECARS][cPos_Z]=Z;
CarInfo[OWNABLECARS][cPos_A]=A;
CarInfo[OWNABLECARS][cCost]=house_price;
CarInfo[OWNABLECARS][cModel]=idcar;
string="";
strmid(CarInfo[OWNABLECARS][cOwner],"The State",0,strlen("The State"),28);
format(string, 144, "Вы успешно создали машину номер {e7e7e7}%d {ffffff}Стоимость покупки: {e7e7e7}%d",OWNABLECARS+1,CarInfo[OWNABLECARS][cCost]);
SendClientMessage(playerid,-1,string);
//
string="";
format(string,1500,"INSERT INTO `ownable`(`ID`,`Model`,`Sell_X`, `Sell_Y`, `Sell_Z`,`Sell_A`, `Pos_X`, `Pos_Y`, `Pos_Z`, `Pos_A`, \
`Color_1`,`Color_2`,`Owner`,`Cost`,`Keyer`,`OnNumber`,`Register`,`OnRegister`) VALUES ('%d','%d','%.2f','%.2f','%.2f','%.2f','%.2f','%.2f','%.2f','%.2f','1','1','The State','%d','The State','The State','The State','The State')",
OWNABLECARS+1,
CarInfo[OWNABLECARS][cModel],
CarInfo[OWNABLECARS][cSell_X],
CarInfo[OWNABLECARS][cSell_Y],
CarInfo[OWNABLECARS][cSell_Z],
CarInfo[OWNABLECARS][cSell_A],
CarInfo[OWNABLECARS][cPos_X],
CarInfo[OWNABLECARS][cPos_Y],
CarInfo[OWNABLECARS][cPos_Z],
CarInfo[OWNABLECARS][cPos_A],
CarInfo[OWNABLECARS][cCost]);
mysql_tquery(mysql, string);
OWNABLECARS++;
return 1;
}
Ко всем new
new CarInfo[MAX_OWNABLECARS][cInfo];