04.03.2011, 13:31
pawn Код:
CMD:vcreate(playerid, params[])
{
new
ivModel,
ivPrice,
Float:X,
Float:Y,
Float:Z,
Float:A,
ivColors[2],
Query[256],
iMsg[148];
ivModel = GetVehicleModel(playerid);
//ivID = GetPlayerVehicleID(playerid);
GetVehiclePos(ivModel , X, Y, Z);
GetVehicleZAngle(ivModel , A);
//if(sscanf(params, "iiii", ivModel, ivPrice, ivColors[0], ivColors[1])) return SendClientMessage(playerid, -1, ""#CRED"Usage: "#CORANGE"/VCreate < Vehicle Model > < Price > < Color 1 > < Color 2 >");
Created++;
vInfo[Created][vModel] = ivModel;
vInfo[Created][vColor1] = 2;
vInfo[Created][vColor2] = 2;
vInfo[Created][vPrice] = 1000;
vInfo[Created][vPosX] = X;
vInfo[Created][vPosY] = Y;
vInfo[Created][vPosZ] = Z;
vInfo[Created][vPosA] = A;
strmid(vInfo[Created][vOwner], "Unbought", 0, 20, 20);
strmid(vInfo[Created][vPlate], "ChangeME", 0, 32, 32);
format(Query, sizeof(Query), "INSERT INTO `privateveh` (`vID`, `vModel`, `vColor1`, `vColor2`, `vPrice`, `vOwner`, `vPosX`, `vPosY`, `vPosZ`, `vPosA`, `vPlate`) VALUES (%d, %d, %d, %d, %d, 'Unbought', %f, %f, %f, %f, 'ChangeME')",
Created,
ivModel,
ivColors[0],
ivColors[1],
ivPrice,
X,
Y,
Z,
A);
mysql_query(Query);
new
cCar = CreateVehicle(ivModel, X, Y, Z, A, ivColors[0], ivColors[1], 500000);
SetVehicleNumberPlate(cCar, "ChangeME");
ivCreated[cCar] = Created;
SavePrivVeh(Created);
format(iMsg, sizeof(iMsg), ""#CYELLOW"Vehicle: "#CBLUE"%i (VID: %i) "#CYELLOW"has been created. Price: "#CBLUE"$%i "#CYELLOW"Plate: "#CBLUE"ChangeME", ivModel, Created, ivPrice);
SendClientMessage(playerid, -1, iMsg);
return 1;
}