Unknown Command
#1

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
PHP код:
CMD:resetcar(playeridparams[])
{
    new 
str[256], cname[256], cname1[256], cname2[256];
    if(
pvehicle[playerid][0] !=0)
    {
        new 
cr[256];
        new 
tvar GetVehicleModel(pvehicle[playerid][0]);
        
format(crsizeof(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(crsizeof(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(crsizeof(cr), "%s"vehName[tvar-400]);
        
cname2=cr;
    }
    else
    {
        
cname2="Empty";
    }
    
format(strsizeof(str), "%s\n%s\n%s"cnamecname1cname2);
    
ShowPlayerDialog(playeridDIALOG_CAR_RESETDIALOG_STYLE_LIST"Choose A Car"str"Select""Cancel");
    return 
1;

here is the dialog ondialogresponce and I have defined the dialog
PHP код:
if(dialogid == DIALOG_CAR_RESET)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:
                {
                    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
                    
format(string50"V_%s_0"playername);
                    new 
strings[100];
                    new 
tvar2 dini_Int(AddDirFile(dir_carfilesstring), "model");
                    new 
panelsdoorslightstiresFloat:health;
                    new 
giveplayerid,moneys1;
                    new 
tvar3tvar4tvar5Float:xFloat:yFloat:zFloat: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 != && GetVehicleInterior(shamalid) == 0)
                        {
                            
GetVehiclePos(shamalidxyz);
                        }
                        else
                        {
                            
adata[plastdoor[playerid]][ax];
                            
adata[plastdoor[playerid]][ay];
                            
adata[plastdoor[playerid]][az];
                        }
                    }
                    else
                    {
                        
GetPlayerPos(playeridxyz);
                    }
                    new 
Float:vxFloat:vyFloat:vzFloat:va;
                    
GetVehiclePos(pvehicle[playerid][0], vxvyvz);
                    
GetVehicleZAngle(pvehicle[playerid][0], va);
                    for (new 
0sizeof(pdCoords); d++) {
                        if (
PointToPoint2D(xypdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(xypdCoords[tvar3][0], pdCoords[tvar3][1])) {
                            
tvar4 = -1;
                            for (new 
0sizeof(pdCarCoords); b++) {
                                if (
pdCarCoords[b][4] == d+&& 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 
0PLAYERSi++) {
                            
format(tmp12"hpevsp%d"pvehicle[playerid][0]);
                            if (
GetPVarInt(itmp) == 1) {
                                
SetPVarInt(itmp0);
                            }
                        }
                    }
                    if (
bootdcp[pvehicle[playerid][0]] != 0) {
                        
DestroyDynamicCP(bootdcp[pvehicle[playerid][0]]);
                        for (new 
0PLAYERSi++) {
                            if (
IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][0]]) {
                                
CallLocalFunction("OnPlayerLeaveDynamicCP""dd"ipdynamiccp[i]);
                            }
                        }
                        
cptype[bootdcp[pvehicle[playerid][0]]][0] = 0;
                        
cptype[bootdcp[pvehicle[playerid][0]]][1] = -1;
                        
bootdcp[pvehicle[playerid][0]] = 0;
                    }
                    if (
tvar5 == -&& GetVehicleVirtualWorld(pvehicle[playerid][0]) == 0) {
                        
GetVehiclePos(pvehicle[playerid][0], xyz);
                        
GetVehicleZAngle(pvehicle[playerid][0], a);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "X"x);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Y"y);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Z"z);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "A"a);
                    }
                    new 
temps1 pvehicle[playerid][0];
                    new 
temps2 GetVehicleModel(temps1);
                    if (
tvar2 == temps2) {
                        
GetVehicleDamageStatus(pvehicle[playerid][0], panelsdoorslightstires);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"panels);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"doors);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"lights);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"tires);
                    }
                    else {
                        
vmodelused[temps2-400] --;
                        if (
vmodelused[temps2-400] == 0vehiclemodels --;
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"0);
                    }
                    
GetVehicleHealth(pvehicle[playerid][0], health);
                    
dini_FloatSet(AddDirFile(dir_carfilesstring), "health"health-1000);
                    
DestroyVehicle(pvehicle[playerid][0]);
                    if(
GetPlayerWantedLevel(playerid)>0)
                    {
                        
pvehicle[playerid][0] = CreateVehicle(tvar2vxvyvzvavehcol[pvehicle[playerid][0]][0], vehcol[pvehicle[playerid][0]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(playerid));
                    }
                    else
                    {
                        
vx += floatsin(-adegrees) * 5.0;
                        
vy += floatcos(-adegrees) * 5.0;
                        
pvehicle[playerid][0] = CreateVehicle(tvar2xyzva+90.0vehcol[pvehicle[playerid][0]][0], vehcol[pvehicle[playerid][0]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(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 
0PLAYERSi++) {
                                if (
!= 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], panelsdoorslightstires);
                    }
                    for (new 
0CAR_MOD_SLOTSd++) {
                        
format(tmp24"mod_s%d"d);
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), tmp)) {
                            
AddVehicleComponent(pvehicle[playerid][0], dini_Int(AddDirFile(dir_carfilesstring), tmp));
                        }
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "paintjob")) {
                        
ChangeVehiclePaintjob(pvehicle[playerid][0], dini_Int(AddDirFile(dir_carfilesstring), "paintjob"));
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "lplate")) {
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), "platecolor")) {
                            
format(tmp32"{%s}%s"dini_Get(AddDirFile(dir_carfilesstring), "platecolor"), dini_Get(AddDirFile(dir_carfilesstring), "lplate"));
                            
SetVehicleNumberPlate2(pvehicle[playerid][0], tmp);
                        }
                        else {
                            
SetVehicleNumberPlate2(pvehicle[playerid][0], dini_Get(AddDirFile(dir_carfilesstring), "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(playeridCOLOR_ORANGEstrings);
                    return 
1;
                }
                case 
1:
                {
                    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
                    
format(string50"V_%s_1"playername);
                    new 
strings[100];
                    new 
tvar2 dini_Int(AddDirFile(dir_carfilesstring), "model");
                    new 
panelsdoorslightstiresFloat:health;
                    new 
giveplayerid,moneys1;
                    new 
tvar3tvar4tvar5Float:xFloat:yFloat:zFloat: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 != && GetVehicleInterior(shamalid) == 0)
                        {
                            
GetVehiclePos(shamalidxyz);
                        }
                        else
                        {
                            
adata[plastdoor[playerid]][ax];
                            
adata[plastdoor[playerid]][ay];
                            
adata[plastdoor[playerid]][az];
                        }
                    }
                    else
                    {
                        
GetPlayerPos(playeridxyz);
                    }
                    new 
Float:vxFloat:vyFloat:vzFloat:va;
                    
GetVehiclePos(pvehicle[playerid][1], vxvyvz);
                    
GetVehicleZAngle(pvehicle[playerid][1], va);
                    for (new 
0sizeof(pdCoords); d++) {
                        if (
PointToPoint2D(xypdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(xypdCoords[tvar3][0], pdCoords[tvar3][1])) {
                            
tvar4 = -1;
                            for (new 
0sizeof(pdCarCoords); b++) {
                                if (
pdCarCoords[b][4] == d+&& 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 
0PLAYERSi++) {
                            
format(tmp12"hpevsp%d"pvehicle[playerid][0]);
                            if (
GetPVarInt(itmp) == 1) {
                                
SetPVarInt(itmp0);
                            }
                        }
                    }
                    if (
bootdcp[pvehicle[playerid][1]] != 0) {
                        
DestroyDynamicCP(bootdcp[pvehicle[playerid][1]]);
                        for (new 
0PLAYERSi++) {
                            if (
IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][1]]) {
                                
CallLocalFunction("OnPlayerLeaveDynamicCP""dd"ipdynamiccp[i]);
                            }
                        }
                        
cptype[bootdcp[pvehicle[playerid][1]]][0] = 0;
                        
cptype[bootdcp[pvehicle[playerid][1]]][1] = -1;
                        
bootdcp[pvehicle[playerid][1]] = 0;
                    }
                    if (
tvar5 == -&& GetVehicleVirtualWorld(pvehicle[playerid][1]) == 0) {
                        
GetVehiclePos(pvehicle[playerid][1], xyz);
                        
GetVehicleZAngle(pvehicle[playerid][1], a);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "X"x);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Y"y);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Z"z);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "A"a);
                    }
                    new 
temps1 pvehicle[playerid][1];
                    new 
temps2 GetVehicleModel(temps1);
                    if (
tvar2 == temps2) {
                        
GetVehicleDamageStatus(pvehicle[playerid][1], panelsdoorslightstires);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"panels);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"doors);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"lights);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"tires);
                    }
                    else {
                        
vmodelused[temps2-400] --;
                        if (
vmodelused[temps2-400] == 0vehiclemodels --;
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"0);
                    }
                    
GetVehicleHealth(pvehicle[playerid][1], health);
                    
dini_FloatSet(AddDirFile(dir_carfilesstring), "health"health-1000);
                    
DestroyVehicle(pvehicle[playerid][1]);
                    if(
GetPlayerWantedLevel(playerid)>0)
                    {
                        
pvehicle[playerid][1] = CreateVehicle(tvar2vxvyvzvavehcol[pvehicle[playerid][1]][0], vehcol[pvehicle[playerid][1]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(playerid));
                    }
                    else
                    {
                         
vx += floatsin(-adegrees) * 5.0;
                        
vy += floatcos(-adegrees) * 5.0;
                        
pvehicle[playerid][1] = CreateVehicle(tvar2xyzva+90.0vehcol[pvehicle[playerid][1]][0], vehcol[pvehicle[playerid][1]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(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 
0PLAYERSi++) {
                                if (
!= 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], panelsdoorslightstires);
                    }
                    for (new 
0CAR_MOD_SLOTSd++) {
                        
format(tmp24"mod_s%d"d);
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), tmp)) {
                            
AddVehicleComponent(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfilesstring), tmp));
                        }
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "paintjob")) {
                        
ChangeVehiclePaintjob(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfilesstring), "paintjob"));
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "lplate")) {
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), "platecolor")) {
                            
format(tmp32"{%s}%s"dini_Get(AddDirFile(dir_carfilesstring), "platecolor"), dini_Get(AddDirFile(dir_carfilesstring), "lplate"));
                            
SetVehicleNumberPlate2(pvehicle[playerid][1], tmp);
                        }
                        else {
                            
SetVehicleNumberPlate2(pvehicle[playerid][1], dini_Get(AddDirFile(dir_carfilesstring), "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(playeridCOLOR_ORANGEstrings);
                    return 
1;
                }
                case 
2:
                {
                    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
                    
format(string50"V_%s_2"playername);
                    new 
strings[100];
                    new 
tvar2 dini_Int(AddDirFile(dir_carfilesstring), "model");
                    new 
panelsdoorslightstiresFloat:health;
                    new 
giveplayerid,moneys1;
                    new 
tvar3tvar4tvar5Float:xFloat:yFloat:zFloat: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 != && GetVehicleInterior(shamalid) == 0)
                        {
                            
GetVehiclePos(shamalidxyz);
                        }
                        else
                        {
                            
adata[plastdoor[playerid]][ax];
                            
adata[plastdoor[playerid]][ay];
                            
adata[plastdoor[playerid]][az];
                        }
                    }
                    else
                    {
                        
GetPlayerPos(playeridxyz);
                    }
                    new 
Float:vxFloat:vyFloat:vzFloat:va;
                    
GetVehiclePos(pvehicle[playerid][2], vxvyvz);
                    
GetVehicleZAngle(pvehicle[playerid][2], va);
                    for (new 
0sizeof(pdCoords); d++) {
                        if (
PointToPoint2D(xypdCoords[d][0], pdCoords[d][1]) <= PointToPoint2D(xypdCoords[tvar3][0], pdCoords[tvar3][1])) {
                            
tvar4 = -1;
                            for (new 
0sizeof(pdCarCoords); b++) {
                                if (
pdCarCoords[b][4] == d+&& 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 
0PLAYERSi++) {
                            
format(tmp12"hpevsp%d"pvehicle[playerid][0]);
                            if (
GetPVarInt(itmp) == 1) {
                                
SetPVarInt(itmp0);
                            }
                        }
                    }
                    if (
bootdcp[pvehicle[playerid][2]] != 0) {
                        
DestroyDynamicCP(bootdcp[pvehicle[playerid][1]]);
                        for (new 
0PLAYERSi++) {
                            if (
IsPlayerConnected2(i) && pdynamiccp[i] == bootdcp[pvehicle[playerid][2]]) {
                                
CallLocalFunction("OnPlayerLeaveDynamicCP""dd"ipdynamiccp[i]);
                            }
                        }
                        
cptype[bootdcp[pvehicle[playerid][2]]][0] = 0;
                        
cptype[bootdcp[pvehicle[playerid][2]]][1] = -1;
                        
bootdcp[pvehicle[playerid][2]] = 0;
                    }
                    if (
tvar5 == -&& GetVehicleVirtualWorld(pvehicle[playerid][2]) == 0) {
                        
GetVehiclePos(pvehicle[playerid][2], xyz);
                        
GetVehicleZAngle(pvehicle[playerid][2], a);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "X"x);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Y"y);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "Z"z);
                        
dini_FloatSet(AddDirFile(dir_carfilesstring), "A"a);
                    }
                    new 
temps1 pvehicle[playerid][2];
                    new 
temps2 GetVehicleModel(temps1);
                    if (
tvar2 == temps2) {
                        
GetVehicleDamageStatus(pvehicle[playerid][2], panelsdoorslightstires);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"panels);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"doors);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"lights);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"tires);
                    }
                    else {
                        
vmodelused[temps2-400] --;
                        if (
vmodelused[temps2-400] == 0vehiclemodels --;
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "panels"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "doors"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "lights"0);
                        
dini_IntSet(AddDirFile(dir_carfilesstring), "tires"0);
                    }
                    
GetVehicleHealth(pvehicle[playerid][2], health);
                    
dini_FloatSet(AddDirFile(dir_carfilesstring), "health"health-1000);
                    
DestroyVehicle(pvehicle[playerid][2]);
                    if(
GetPlayerWantedLevel(playerid)>0)
                    {
                        
pvehicle[playerid][2] = CreateVehicle(tvar2vxvyvzvavehcol[pvehicle[playerid][2]][0], vehcol[pvehicle[playerid][2]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(playerid));
                    }
                    else
                    {
                         
vx += floatsin(-adegrees) * 5.0;
                        
vy += floatcos(-adegrees) * 5.0;
                        
pvehicle[playerid][2] = CreateVehicle(tvar2xyzva+90.0vehcol[pvehicle[playerid][2]][0], vehcol[pvehicle[playerid][2]][1], -1);
                        
LinkVehicleToInterior2(tvar2GetPlayerInterior(playerid));
                        
SetVehicleVirtualWorld(tvar2GetPlayerVirtualWorld(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 
0PLAYERSi++) {
                                if (
!= 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], panelsdoorslightstires);
                    }
                    for (new 
0CAR_MOD_SLOTSd++) {
                        
format(tmp24"mod_s%d"d);
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), tmp)) {
                            
AddVehicleComponent(pvehicle[playerid][1], dini_Int(AddDirFile(dir_carfilesstring), tmp));
                        }
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "paintjob")) {
                        
ChangeVehiclePaintjob(pvehicle[playerid][2], dini_Int(AddDirFile(dir_carfilesstring), "paintjob"));
                    }
                    if (
dini_Isset(AddDirFile(dir_carfilesstring), "lplate")) {
                        if (
dini_Isset(AddDirFile(dir_carfilesstring), "platecolor")) {
                            
format(tmp32"{%s}%s"dini_Get(AddDirFile(dir_carfilesstring), "platecolor"), dini_Get(AddDirFile(dir_carfilesstring), "lplate"));
                            
SetVehicleNumberPlate2(pvehicle[playerid][2], tmp);
                        }
                        else {
                            
SetVehicleNumberPlate2(pvehicle[playerid][2], dini_Get(AddDirFile(dir_carfilesstring), "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(playeridCOLOR_ORANGEstrings);
                    return 
1;
                }
            }
        }
        return 
1;
    } 
plz help thanks
Reply


Messages In This Thread
Unknown Command - by silverms - 18.04.2017, 08:06
Re: Unknown Command - by Konstantinos - 18.04.2017, 08:46
Re: Unknown Command - by silverms - 18.04.2017, 09:24

Forum Jump:


Users browsing this thread: 1 Guest(s)