18.04.2017, 08:06
I have this command resetcar it can only work once when I type it once I cant type it another time cause it say unknown command here is the code
here is the dialog ondialogresponce and I have defined the dialog
plz help thanks
PHP код:
CMD:resetcar(playerid, params[])
{
new str[256], cname[256], cname1[256], cname2[256];
if(pvehicle[playerid][0] !=0)
{
new cr[256];
new tvar = GetVehicleModel(pvehicle[playerid][0]);
format(cr, sizeof(cr), "%s", vehName[tvar-400]);
cname=cr;
}
else
{
cname="Empty";
}
if(pvehicle[playerid][1] !=0)
{
new cr[256];
new tvar = GetVehicleModel(pvehicle[playerid][1]);
format(cr, sizeof(cr), "%s", vehName[tvar-400]);
cname1=cr;
}
else
{
cname1="Empty";
}
if(pvehicle[playerid][2] !=0)
{
new cr[256];
new tvar = GetVehicleModel(pvehicle[playerid][2]);
format(cr, sizeof(cr), "%s", vehName[tvar-400]);
cname2=cr;
}
else
{
cname2="Empty";
}
format(str, sizeof(str), "%s\n%s\n%s", cname, cname1, cname2);
ShowPlayerDialog(playerid, DIALOG_CAR_RESET, DIALOG_STYLE_LIST, "Choose A Car", str, "Select", "Cancel");
return 1;
}
PHP код:
if(dialogid == DIALOG_CAR_RESET)
{
if(response)
{
switch(listitem)
{
case 0:
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, 50, "V_%s_0", playername);
new strings[100];
new tvar2 = dini_Int(AddDirFile(dir_carfiles, string), "model");
new panels, doors, lights, tires, Float:health;
new giveplayerid,moneys1;
new tvar3, tvar4, tvar5, Float:x, Float:y, Float:z, Float:a;
giveplayerid = -1;
tvar5 = vehstored[pvehicle[playerid][0]];
if (tvar5 != -1) {
holdsv[tvar5] = 0;
vehstored[pvehicle[playerid][0]] = -1;
}
if (GetPlayerInterior(playerid) != 0)
{
new shamalid = GetPlayerShamalID(playerid);
if (shamalid != 0 && GetVehicleInterior(shamalid) == 0)
{
GetVehiclePos(shamalid, x, y, z);
}
else
{
x = adata[plastdoor[playerid]][ax];
y = adata[plastdoor[playerid]][ay];
z = adata[plastdoor[playerid]][az];
}
}
else
{
GetPlayerPos(playerid, x, y, z);
}
new Float:vx, Float:vy, Float:vz, Float:va;
GetVehiclePos(pvehicle[playerid][0], vx, vy, vz);
GetVehicleZAngle(pvehicle[playerid][0], va);
for (new d = 0; d < sizeof(pdCoords); d++) {
if (PointToPoint2D(x, y, pdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(x, y, pdCoords[tvar3][0], pdCoords[tvar3][1])) {
tvar4 = -1;
for (new b = 0; b < sizeof(pdCarCoords); b++) {
if (pdCarCoords[b][4] == d+1 && holdsv[b] == 0) {
tvar4 = b;
break;
}
}
if (tvar4 != -1) {
giveplayerid = d;
moneys1 = tvar4;
}
tvar3 = d;
}
}
if (tvar2 == 457 || tvar2 == 596 || tvar2 == 597 || tvar2 == 598) {
for (new i = 0; i < PLAYERS; i++) {
format(tmp, 12, "hpevsp%d", pvehicle[playerid][0]);
if (GetPVarInt(i, tmp) == 1) {
SetPVarInt(i, tmp, 0);
}
}
}
if (bootdcp[pvehicle[playerid][0]] != 0) {
DestroyDynamicCP(bootdcp[pvehicle[playerid][0]]);
for (new i = 0; i < PLAYERS; i++) {
if (IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][0]]) {
CallLocalFunction("OnPlayerLeaveDynamicCP", "dd", i, pdynamiccp[i]);
}
}
cptype[bootdcp[pvehicle[playerid][0]]][0] = 0;
cptype[bootdcp[pvehicle[playerid][0]]][1] = -1;
bootdcp[pvehicle[playerid][0]] = 0;
}
if (tvar5 == -1 && GetVehicleVirtualWorld(pvehicle[playerid][0]) == 0) {
GetVehiclePos(pvehicle[playerid][0], x, y, z);
GetVehicleZAngle(pvehicle[playerid][0], a);
dini_FloatSet(AddDirFile(dir_carfiles, string), "X", x);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Y", y);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Z", z);
dini_FloatSet(AddDirFile(dir_carfiles, string), "A", a);
}
new temps1 = pvehicle[playerid][0];
new temps2 = GetVehicleModel(temps1);
if (tvar2 == temps2) {
GetVehicleDamageStatus(pvehicle[playerid][0], panels, doors, lights, tires);
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", panels);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", doors);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", lights);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", tires);
}
else {
vmodelused[temps2-400] --;
if (vmodelused[temps2-400] == 0) vehiclemodels --;
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", 0);
}
GetVehicleHealth(pvehicle[playerid][0], health);
dini_FloatSet(AddDirFile(dir_carfiles, string), "health", health-1000);
DestroyVehicle(pvehicle[playerid][0]);
if(GetPlayerWantedLevel(playerid)>0)
{
pvehicle[playerid][0] = CreateVehicle(tvar2, vx, vy, vz, va, vehcol[pvehicle[playerid][0]][0], vehcol[pvehicle[playerid][0]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
else
{
vx += floatsin(-a, degrees) * 5.0;
vy += floatcos(-a, degrees) * 5.0;
pvehicle[playerid][0] = CreateVehicle(tvar2, x, y, z, va+90.0, vehcol[pvehicle[playerid][0]][0], vehcol[pvehicle[playerid][0]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
if (pvehicle[playerid][0] != temps1) {
vehcol[pvehicle[playerid][0]][0] = vehcol[temps1][0];
vehcol[pvehicle[playerid][0]][1] = vehcol[temps1][1];
vehcol[temps1][0] = 0;
vehcol[temps1][1] = 0;
if (bootdata[temps1][0][0] != 0)
{
bootdata[pvehicle[playerid][0]][0][0] = bootdata[temps1][0][0];
bootdata[temps1][0][0] = 0;
bootdata[pvehicle[playerid][0]][0][1] = bootdata[temps1][0][1];
bootdata[temps1][0][1] = 0;
bootdata[pvehicle[playerid][0]][0][2] = bootdata[temps1][0][2];
bootdata[temps1][0][2] = 0;
bootdata[pvehicle[playerid][0]][0][3] = bootdata[temps1][0][3];
bootdata[temps1][0][3] = 0;
bootdata[pvehicle[playerid][0]][0][4] = bootdata[temps1][0][4];
bootdata[temps1][0][4] = 0;
}
if (bootdata[temps1][1][0] != 0)
{
bootdata[pvehicle[playerid][0]][1][0] = bootdata[temps1][1][0];
bootdata[temps1][1][0] = 0;
bootdata[pvehicle[playerid][0]][1][1] = bootdata[temps1][1][1];
bootdata[temps1][1][1] = 0;
bootdata[pvehicle[playerid][0]][1][2] = bootdata[temps1][1][2];
bootdata[temps1][1][2] = 0;
bootdata[pvehicle[playerid][0]][1][3] = bootdata[temps1][1][3];
bootdata[temps1][1][3] = 0;
bootdata[pvehicle[playerid][0]][1][4] = bootdata[temps1][1][4];
bootdata[temps1][1][4] = 0;
}
if (plockedveh[playerid] == temps1) {
for (new i = 0; i < PLAYERS; i++) {
if (i != playerid) {
vehiclelocked[i][temps1] = false;
vehiclelocked[i][pvehicle[playerid][0]] = true;
}
}
plockedveh[playerid] = pvehicle[playerid][0];
}
Gas[pvehicle[playerid][0]] = Gas[temps1];
Gas[temps1] = FuelMax;
}
//
SetVehicleHealth(pvehicle[playerid][0], health);
if (tvar2 == temp2) {
UpdateVehicleDamageStatus(pvehicle[playerid][0], panels, doors, lights, tires);
}
for (new d = 0; d < CAR_MOD_SLOTS; d++) {
format(tmp, 24, "mod_s%d", d);
if (dini_Isset(AddDirFile(dir_carfiles, string), tmp)) {
AddVehicleComponent(pvehicle[playerid][0], dini_Int(AddDirFile(dir_carfiles, string), tmp));
}
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "paintjob")) {
ChangeVehiclePaintjob(pvehicle[playerid][0], dini_Int(AddDirFile(dir_carfiles, string), "paintjob"));
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "lplate")) {
if (dini_Isset(AddDirFile(dir_carfiles, string), "platecolor")) {
format(tmp, 32, "{%s}%s", dini_Get(AddDirFile(dir_carfiles, string), "platecolor"), dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
SetVehicleNumberPlate2(pvehicle[playerid][0], tmp);
}
else {
SetVehicleNumberPlate2(pvehicle[playerid][0], dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
}
}
vehstored[pvehicle[playerid][0]] = moneys1;
holdsv[moneys1] = pvehicle[playerid][0];
format(strings,sizeof(strings),"Your %s has been reseted [/tv]",vehName[tvar2-400], pdNames[giveplayerid]);
SendClientMessage2(playerid, COLOR_ORANGE, strings);
return 1;
}
case 1:
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, 50, "V_%s_1", playername);
new strings[100];
new tvar2 = dini_Int(AddDirFile(dir_carfiles, string), "model");
new panels, doors, lights, tires, Float:health;
new giveplayerid,moneys1;
new tvar3, tvar4, tvar5, Float:x, Float:y, Float:z, Float:a;
giveplayerid = -1;
tvar5 = vehstored[pvehicle[playerid][1]];
if (tvar5 != -1) {
holdsv[tvar5] = 0;
vehstored[pvehicle[playerid][1]] = -1;
}
if (GetPlayerInterior(playerid) != 0)
{
new shamalid = GetPlayerShamalID(playerid);
if (shamalid != 0 && GetVehicleInterior(shamalid) == 0)
{
GetVehiclePos(shamalid, x, y, z);
}
else
{
x = adata[plastdoor[playerid]][ax];
y = adata[plastdoor[playerid]][ay];
z = adata[plastdoor[playerid]][az];
}
}
else
{
GetPlayerPos(playerid, x, y, z);
}
new Float:vx, Float:vy, Float:vz, Float:va;
GetVehiclePos(pvehicle[playerid][1], vx, vy, vz);
GetVehicleZAngle(pvehicle[playerid][1], va);
for (new d = 0; d < sizeof(pdCoords); d++) {
if (PointToPoint2D(x, y, pdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(x, y, pdCoords[tvar3][0], pdCoords[tvar3][1])) {
tvar4 = -1;
for (new b = 0; b < sizeof(pdCarCoords); b++) {
if (pdCarCoords[b][4] == d+1 && holdsv[b] == 0) {
tvar4 = b;
break;
}
}
if (tvar4 != -1) {
giveplayerid = d;
moneys1 = tvar4;
}
tvar3 = d;
}
}
if (tvar2 == 457 || tvar2 == 596 || tvar2 == 597 || tvar2 == 598) {
for (new i = 0; i < PLAYERS; i++) {
format(tmp, 12, "hpevsp%d", pvehicle[playerid][0]);
if (GetPVarInt(i, tmp) == 1) {
SetPVarInt(i, tmp, 0);
}
}
}
if (bootdcp[pvehicle[playerid][1]] != 0) {
DestroyDynamicCP(bootdcp[pvehicle[playerid][1]]);
for (new i = 0; i < PLAYERS; i++) {
if (IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][1]]) {
CallLocalFunction("OnPlayerLeaveDynamicCP", "dd", i, pdynamiccp[i]);
}
}
cptype[bootdcp[pvehicle[playerid][1]]][0] = 0;
cptype[bootdcp[pvehicle[playerid][1]]][1] = -1;
bootdcp[pvehicle[playerid][1]] = 0;
}
if (tvar5 == -1 && GetVehicleVirtualWorld(pvehicle[playerid][1]) == 0) {
GetVehiclePos(pvehicle[playerid][1], x, y, z);
GetVehicleZAngle(pvehicle[playerid][1], a);
dini_FloatSet(AddDirFile(dir_carfiles, string), "X", x);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Y", y);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Z", z);
dini_FloatSet(AddDirFile(dir_carfiles, string), "A", a);
}
new temps1 = pvehicle[playerid][1];
new temps2 = GetVehicleModel(temps1);
if (tvar2 == temps2) {
GetVehicleDamageStatus(pvehicle[playerid][1], panels, doors, lights, tires);
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", panels);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", doors);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", lights);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", tires);
}
else {
vmodelused[temps2-400] --;
if (vmodelused[temps2-400] == 0) vehiclemodels --;
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", 0);
}
GetVehicleHealth(pvehicle[playerid][1], health);
dini_FloatSet(AddDirFile(dir_carfiles, string), "health", health-1000);
DestroyVehicle(pvehicle[playerid][1]);
if(GetPlayerWantedLevel(playerid)>0)
{
pvehicle[playerid][1] = CreateVehicle(tvar2, vx, vy, vz, va, vehcol[pvehicle[playerid][1]][0], vehcol[pvehicle[playerid][1]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
else
{
vx += floatsin(-a, degrees) * 5.0;
vy += floatcos(-a, degrees) * 5.0;
pvehicle[playerid][1] = CreateVehicle(tvar2, x, y, z, va+90.0, vehcol[pvehicle[playerid][1]][0], vehcol[pvehicle[playerid][1]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
if (pvehicle[playerid][0] != temps1) {
vehcol[pvehicle[playerid][1]][0] = vehcol[temps1][0];
vehcol[pvehicle[playerid][1]][1] = vehcol[temps1][1];
vehcol[temps1][0] = 0;
vehcol[temps1][1] = 0;
if (bootdata[temps1][1][0] != 0)
{
bootdata[pvehicle[playerid][1]][0][0] = bootdata[temps1][0][0];
bootdata[temps1][0][0] = 0;
bootdata[pvehicle[playerid][1]][0][1] = bootdata[temps1][0][1];
bootdata[temps1][0][1] = 0;
bootdata[pvehicle[playerid][1]][0][2] = bootdata[temps1][0][2];
bootdata[temps1][0][2] = 0;
bootdata[pvehicle[playerid][1]][0][3] = bootdata[temps1][0][3];
bootdata[temps1][0][3] = 0;
bootdata[pvehicle[playerid][1]][0][4] = bootdata[temps1][0][4];
bootdata[temps1][0][4] = 0;
}
if (bootdata[temps1][1][0] != 0)
{
bootdata[pvehicle[playerid][1]][1][0] = bootdata[temps1][1][0];
bootdata[temps1][1][0] = 0;
bootdata[pvehicle[playerid][1]][1][1] = bootdata[temps1][1][1];
bootdata[temps1][1][1] = 0;
bootdata[pvehicle[playerid][1]][1][2] = bootdata[temps1][1][2];
bootdata[temps1][1][2] = 0;
bootdata[pvehicle[playerid][1]][1][3] = bootdata[temps1][1][3];
bootdata[temps1][1][3] = 0;
bootdata[pvehicle[playerid][1]][1][4] = bootdata[temps1][1][4];
bootdata[temps1][1][4] = 0;
}
if (plockedveh[playerid] == temps1) {
for (new i = 0; i < PLAYERS; i++) {
if (i != playerid) {
vehiclelocked[i][temps1] = false;
vehiclelocked[i][pvehicle[playerid][1]] = true;
}
}
plockedveh[playerid] = pvehicle[playerid][1];
}
Gas[pvehicle[playerid][1]] = Gas[temps1];
Gas[temps1] = FuelMax;
}
//
SetVehicleHealth(pvehicle[playerid][1], health);
if (tvar2 == temp2) {
UpdateVehicleDamageStatus(pvehicle[playerid][1], panels, doors, lights, tires);
}
for (new d = 0; d < CAR_MOD_SLOTS; d++) {
format(tmp, 24, "mod_s%d", d);
if (dini_Isset(AddDirFile(dir_carfiles, string), tmp)) {
AddVehicleComponent(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfiles, string), tmp));
}
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "paintjob")) {
ChangeVehiclePaintjob(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfiles, string), "paintjob"));
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "lplate")) {
if (dini_Isset(AddDirFile(dir_carfiles, string), "platecolor")) {
format(tmp, 32, "{%s}%s", dini_Get(AddDirFile(dir_carfiles, string), "platecolor"), dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
SetVehicleNumberPlate2(pvehicle[playerid][1], tmp);
}
else {
SetVehicleNumberPlate2(pvehicle[playerid][1], dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
}
}
vehstored[pvehicle[playerid][1]] = moneys1;
holdsv[moneys1] = pvehicle[playerid][1];
format(strings,sizeof(strings),"Your %s has been reseted [/tv]",vehName[tvar2-400], pdNames[giveplayerid]);
SendClientMessage2(playerid, COLOR_ORANGE, strings);
return 1;
}
case 2:
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, 50, "V_%s_2", playername);
new strings[100];
new tvar2 = dini_Int(AddDirFile(dir_carfiles, string), "model");
new panels, doors, lights, tires, Float:health;
new giveplayerid,moneys1;
new tvar3, tvar4, tvar5, Float:x, Float:y, Float:z, Float:a;
giveplayerid = -1;
tvar5 = vehstored[pvehicle[playerid][2]];
if (tvar5 != -1) {
holdsv[tvar5] = 0;
vehstored[pvehicle[playerid][2]] = -1;
}
if (GetPlayerInterior(playerid) != 0)
{
new shamalid = GetPlayerShamalID(playerid);
if (shamalid != 0 && GetVehicleInterior(shamalid) == 0)
{
GetVehiclePos(shamalid, x, y, z);
}
else
{
x = adata[plastdoor[playerid]][ax];
y = adata[plastdoor[playerid]][ay];
z = adata[plastdoor[playerid]][az];
}
}
else
{
GetPlayerPos(playerid, x, y, z);
}
new Float:vx, Float:vy, Float:vz, Float:va;
GetVehiclePos(pvehicle[playerid][2], vx, vy, vz);
GetVehicleZAngle(pvehicle[playerid][2], va);
for (new d = 0; d < sizeof(pdCoords); d++) {
if (PointToPoint2D(x, y, pdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(x, y, pdCoords[tvar3][0], pdCoords[tvar3][1])) {
tvar4 = -1;
for (new b = 0; b < sizeof(pdCarCoords); b++) {
if (pdCarCoords[b][4] == d+1 && holdsv[b] == 0) {
tvar4 = b;
break;
}
}
if (tvar4 != -1) {
giveplayerid = d;
moneys1 = tvar4;
}
tvar3 = d;
}
}
if (tvar2 == 457 || tvar2 == 596 || tvar2 == 597 || tvar2 == 598) {
for (new i = 0; i < PLAYERS; i++) {
format(tmp, 12, "hpevsp%d", pvehicle[playerid][0]);
if (GetPVarInt(i, tmp) == 1) {
SetPVarInt(i, tmp, 0);
}
}
}
if (bootdcp[pvehicle[playerid][2]] != 0) {
DestroyDynamicCP(bootdcp[pvehicle[playerid][1]]);
for (new i = 0; i < PLAYERS; i++) {
if (IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][2]]) {
CallLocalFunction("OnPlayerLeaveDynamicCP", "dd", i, pdynamiccp[i]);
}
}
cptype[bootdcp[pvehicle[playerid][2]]][0] = 0;
cptype[bootdcp[pvehicle[playerid][2]]][1] = -1;
bootdcp[pvehicle[playerid][2]] = 0;
}
if (tvar5 == -1 && GetVehicleVirtualWorld(pvehicle[playerid][2]) == 0) {
GetVehiclePos(pvehicle[playerid][2], x, y, z);
GetVehicleZAngle(pvehicle[playerid][2], a);
dini_FloatSet(AddDirFile(dir_carfiles, string), "X", x);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Y", y);
dini_FloatSet(AddDirFile(dir_carfiles, string), "Z", z);
dini_FloatSet(AddDirFile(dir_carfiles, string), "A", a);
}
new temps1 = pvehicle[playerid][2];
new temps2 = GetVehicleModel(temps1);
if (tvar2 == temps2) {
GetVehicleDamageStatus(pvehicle[playerid][2], panels, doors, lights, tires);
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", panels);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", doors);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", lights);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", tires);
}
else {
vmodelused[temps2-400] --;
if (vmodelused[temps2-400] == 0) vehiclemodels --;
dini_IntSet(AddDirFile(dir_carfiles, string), "panels", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "doors", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "lights", 0);
dini_IntSet(AddDirFile(dir_carfiles, string), "tires", 0);
}
GetVehicleHealth(pvehicle[playerid][2], health);
dini_FloatSet(AddDirFile(dir_carfiles, string), "health", health-1000);
DestroyVehicle(pvehicle[playerid][2]);
if(GetPlayerWantedLevel(playerid)>0)
{
pvehicle[playerid][2] = CreateVehicle(tvar2, vx, vy, vz, va, vehcol[pvehicle[playerid][2]][0], vehcol[pvehicle[playerid][2]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
else
{
vx += floatsin(-a, degrees) * 5.0;
vy += floatcos(-a, degrees) * 5.0;
pvehicle[playerid][2] = CreateVehicle(tvar2, x, y, z, va+90.0, vehcol[pvehicle[playerid][2]][0], vehcol[pvehicle[playerid][2]][1], -1);
LinkVehicleToInterior2(tvar2, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(tvar2, GetPlayerVirtualWorld(playerid));
}
if (pvehicle[playerid][0] != temps1) {
vehcol[pvehicle[playerid][2]][0] = vehcol[temps1][0];
vehcol[pvehicle[playerid][2]][1] = vehcol[temps1][1];
vehcol[temps1][0] = 0;
vehcol[temps1][1] = 0;
if (bootdata[temps1][1][0] != 0)
{
bootdata[pvehicle[playerid][2]][0][0] = bootdata[temps1][0][0];
bootdata[temps1][0][0] = 0;
bootdata[pvehicle[playerid][2]][0][1] = bootdata[temps1][0][1];
bootdata[temps1][0][1] = 0;
bootdata[pvehicle[playerid][2]][0][2] = bootdata[temps1][0][2];
bootdata[temps1][0][2] = 0;
bootdata[pvehicle[playerid][2]][0][3] = bootdata[temps1][0][3];
bootdata[temps1][0][3] = 0;
bootdata[pvehicle[playerid][2]][0][4] = bootdata[temps1][0][4];
bootdata[temps1][0][4] = 0;
}
if (bootdata[temps1][1][0] != 0)
{
bootdata[pvehicle[playerid][2]][1][0] = bootdata[temps1][1][0];
bootdata[temps1][1][0] = 0;
bootdata[pvehicle[playerid][2]][1][1] = bootdata[temps1][1][1];
bootdata[temps1][1][1] = 0;
bootdata[pvehicle[playerid][2]][1][2] = bootdata[temps1][1][2];
bootdata[temps1][1][2] = 0;
bootdata[pvehicle[playerid][2]][1][3] = bootdata[temps1][1][3];
bootdata[temps1][1][3] = 0;
bootdata[pvehicle[playerid][2]][1][4] = bootdata[temps1][1][4];
bootdata[temps1][1][4] = 0;
}
if (plockedveh[playerid] == temps1) {
for (new i = 0; i < PLAYERS; i++) {
if (i != playerid) {
vehiclelocked[i][temps1] = false;
vehiclelocked[i][pvehicle[playerid][2]] = true;
}
}
plockedveh[playerid] = pvehicle[playerid][2];
}
Gas[pvehicle[playerid][2]] = Gas[temps1];
Gas[temps1] = FuelMax;
}
//
SetVehicleHealth(pvehicle[playerid][2], health);
if (tvar2 == temp2) {
UpdateVehicleDamageStatus(pvehicle[playerid][2], panels, doors, lights, tires);
}
for (new d = 0; d < CAR_MOD_SLOTS; d++) {
format(tmp, 24, "mod_s%d", d);
if (dini_Isset(AddDirFile(dir_carfiles, string), tmp)) {
AddVehicleComponent(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfiles, string), tmp));
}
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "paintjob")) {
ChangeVehiclePaintjob(pvehicle[playerid][2], dini_Int(AddDirFile(dir_carfiles, string), "paintjob"));
}
if (dini_Isset(AddDirFile(dir_carfiles, string), "lplate")) {
if (dini_Isset(AddDirFile(dir_carfiles, string), "platecolor")) {
format(tmp, 32, "{%s}%s", dini_Get(AddDirFile(dir_carfiles, string), "platecolor"), dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
SetVehicleNumberPlate2(pvehicle[playerid][2], tmp);
}
else {
SetVehicleNumberPlate2(pvehicle[playerid][2], dini_Get(AddDirFile(dir_carfiles, string), "lplate"));
}
}
vehstored[pvehicle[playerid][2]] = moneys1;
holdsv[moneys1] = pvehicle[playerid][2];
format(strings,sizeof(strings),"Your %s has been reseted [/tv]",vehName[tvar2-400], pdNames[giveplayerid]);
SendClientMessage2(playerid, COLOR_ORANGE, strings);
return 1;
}
}
}
return 1;
}