04.10.2011, 13:50
(
Последний раз редактировалось Unte99; 04.10.2011 в 15:23.
)
Hi all,
To begin with, one day i was scripting my gamemode, doing stuff, upgrading things. When i was upgrading the car's system, i remade a dialog, from a message box to a list type. Before that, the whole gamemode worked fine. After the dialog type change and a little different script i got some errors. I fixed them, but when i logged into the server to try the script and when i entered a car the dialog didn't show up anymore. I tried to change back the script, but it didn't affect the gamemode, even i got back the old script. It kind of left in the server files or something... I even tried to get in the folder the old gamemode, but still, the dialog wouldn't show up. If i compile the corrupted gamemode in a different folder with the requirable files, the folder itself gets corrupted... I don't know how to explain it... The gamemode works, but the dialog doesn't pop up, even if it's an old version of my gm. It's like an expanding virus or something like that. I'm in a hurry. I'll ad the script later. If it happened to someone else, I would appreciate it if you could tell me what you did to fix it.
Here's the script:
To begin with, one day i was scripting my gamemode, doing stuff, upgrading things. When i was upgrading the car's system, i remade a dialog, from a message box to a list type. Before that, the whole gamemode worked fine. After the dialog type change and a little different script i got some errors. I fixed them, but when i logged into the server to try the script and when i entered a car the dialog didn't show up anymore. I tried to change back the script, but it didn't affect the gamemode, even i got back the old script. It kind of left in the server files or something... I even tried to get in the folder the old gamemode, but still, the dialog wouldn't show up. If i compile the corrupted gamemode in a different folder with the requirable files, the folder itself gets corrupted... I don't know how to explain it... The gamemode works, but the dialog doesn't pop up, even if it's an old version of my gm. It's like an expanding virus or something like that. I'm in a hurry. I'll ad the script later. If it happened to someone else, I would appreciate it if you could tell me what you did to fix it.
Here's the script:
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(playerid);
if(VehOwned[veh] == 0 || VehOwned2[veh] == 0)
{
if(IsADealerCar[veh] == 1)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Maљinų pirkimas","Benzinine\nDyzeline", "Pasirinkti", "Atgal");
}
}
else if(VehOwned[veh] == 1)
{
new owner[24], string[128];
GetPlayerName(OwnerID[veh], owner, sizeof(owner));
format(string, sizeof(string), "[LRG6]:Љi maљina priklauso ћaidėjui %s.", owner);
return SendClientMessage(playerid, 0xFFFFFFAA, string);
}
return 1;
}
pawn Код:
if(dialogid == 12)
{
if(response)
{
if(listitem == 0)
{
if(gPlayerHasCar[playerid] == 0)
{
new file[256], name[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
new veh = GetPlayerVehicleID(playerid);
new money = GetPlayerMoney(playerid);
if(money >= CarPrice[veh])
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file);
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]=0);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]=0);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]=0);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]=0);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]=0);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]=0);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]=0);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]=0);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]=0);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]=0);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]=0);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]=0);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]=0);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]=0);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]=0);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]=0);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]=0);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]=0);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]=1);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]=1);
dini_IntSet(file, "Benzinine", VehicleInfo[playerid][Benzinine]=1);
dini_IntSet(file, "Dyzeline", VehicleInfo[playerid][Dyzeline]=0);
Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 196.9075,-264.8788,1.3181,271.7654, 1, 1, 3600000);
format(string, sizeof(string), "Ruoљiama jūsų maљina %i.", veh);
SendClientMessage(playerid, 0xAFAFAFAA, string);
VehicleInfo[playerid][Model] = GetVehicleModel(veh);
VehicleInfo[playerid][Price] = CarPrice[veh];
VehicleInfo[playerid][CarX] = 2130.1914;
VehicleInfo[playerid][CarY] = -1109.5881;
VehicleInfo[playerid][CarZ] = 25.1890;
VehicleInfo[playerid][CarRot] = 76.2599;
gPlayerHasCar[playerid] = 1;
OwnerID[Vehicle[playerid]] = playerid;
VehPlate[Vehicle[playerid]] = "XYZR 000";
RemovePlayerFromVehicle(playerid);
GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
}
else if(money < CarPrice[veh])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, "[LRG6]: Turi per maћai pinigų.");
return 1;
}
}
else if(gPlayerHasCar2[playerid] == 0)
{
new file2[256], name2[MAX_PLAYER_NAME], string2[64];
GetPlayerName(playerid, name2, sizeof(name2));
format(file2,sizeof(file2),"Cars/%s2.ini",name2);
new veh2 = GetPlayerVehicleID(playerid);
new money2 = GetPlayerMoney(playerid);
if(money2 >= CarPrice[veh2])
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file2);
GetPlayerName(playerid, name2, 26);
format(file2,sizeof(file2),"Cars/%s2.ini",name2);
dini_IntSet(file2, "Model2", VehicleInfo2[playerid][Model2]);
dini_IntSet(file2, "Price2", VehicleInfo2[playerid][Price2]);
dini_FloatSet(file2, "Rot2", VehicleInfo2[playerid][CarRot2]);
dini_IntSet(file2, "Locked2", VehicleInfo2[playerid][Locked2]);
dini_IntSet(file2, "mod12", VehicleInfo2[playerid][mod12]=0);
dini_IntSet(file2, "mod22", VehicleInfo2[playerid][mod22]=0);
dini_IntSet(file2, "mod32", VehicleInfo2[playerid][mod32]=0);
dini_IntSet(file2, "mod42", VehicleInfo2[playerid][mod42]=0);
dini_IntSet(file2, "mod52", VehicleInfo2[playerid][mod52]=0);
dini_IntSet(file2, "mod62", VehicleInfo2[playerid][mod62]=0);
dini_IntSet(file2, "mod72", VehicleInfo2[playerid][mod72]=0);
dini_IntSet(file2, "mod82", VehicleInfo2[playerid][mod82]=0);
dini_IntSet(file2, "mod92", VehicleInfo2[playerid][mod92]=0);
dini_IntSet(file2, "mod102", VehicleInfo2[playerid][mod102]=0);
dini_IntSet(file2, "mod112", VehicleInfo2[playerid][mod112]=0);
dini_IntSet(file2, "mod122", VehicleInfo2[playerid][mod122]=0);
dini_IntSet(file2, "mod132", VehicleInfo2[playerid][mod132]=0);
dini_IntSet(file2, "mod142", VehicleInfo2[playerid][mod142]=0);
dini_IntSet(file2, "mod152", VehicleInfo2[playerid][mod152]=0);
dini_IntSet(file2, "mod162", VehicleInfo2[playerid][mod162]=0);
dini_IntSet(file2, "mod172", VehicleInfo2[playerid][mod172]=0);
dini_IntSet(file2, "paintjob2", VehicleInfo2[playerid][paintjob2]=0);
dini_IntSet(file2, "color12", VehicleInfo2[playerid][colora2]=1);
dini_IntSet(file2, "color22", VehicleInfo2[playerid][colorb2]=1);
dini_IntSet(file2, "Benzinine2", VehicleInfo2[playerid][Benzinine2]=1);
dini_IntSet(file2, "Dyzeline2", VehicleInfo2[playerid][Dyzeline2]=0);
Vehicle2[playerid] = CreateVehicle(GetVehicleModel(veh2), 196.9075,-264.8788,1.3181,271.7654, 1, 1, 3600000);
format(string2, sizeof(string2), "Ruoљiama jūsų maљina %i.", veh2);
SendClientMessage(playerid, 0xAFAFAFAA, string2);
VehicleInfo2[playerid][Model2] = GetVehicleModel(veh2);
VehicleInfo2[playerid][Price2] = CarPrice[veh2];
VehicleInfo2[playerid][CarX2] = 2130.1914;
VehicleInfo2[playerid][CarY2] = -1109.5881;
VehicleInfo2[playerid][CarZ2] = 25.1890;
VehicleInfo2[playerid][CarRot2] = 76.2599;
gPlayerHasCar2[playerid] = 1;
OwnerID2[Vehicle2[playerid]] = playerid;
VehPlate2[Vehicle2[playerid]] = "XYZR 000";
RemovePlayerFromVehicle(playerid);
GivePlayerMoney(playerid, -VehicleInfo2[playerid][Price2]);
}
else if(money2 < CarPrice[veh2])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, "[LRG6]: Turi per maћai pinigų.");
return 1;
}
}
else if(gPlayerHasCar2[playerid] == 1)
{
RemovePlayerFromVehicle(playerid);
return 1;
}
}
if(listitem==1)
{
if(gPlayerHasCar[playerid] == 0)
{
new file[256], name[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"Cars/%s.ini",name);
new veh = GetPlayerVehicleID(playerid);
new money = GetPlayerMoney(playerid);
if(money >= CarPrice[veh])
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file);
GetPlayerName(playerid, name, 24);
format(file,sizeof(file),"Cars/%s.ini",name);
dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]=0);
dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]=0);
dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]=0);
dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]=0);
dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]=0);
dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]=0);
dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]=0);
dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]=0);
dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]=0);
dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]=0);
dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]=0);
dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]=0);
dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]=0);
dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]=0);
dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]=0);
dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]=0);
dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]=0);
dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]=0);
dini_IntSet(file, "color1", VehicleInfo[playerid][colora]=1);
dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]=1);
dini_IntSet(file, "Benzinine", VehicleInfo[playerid][Benzinine]=0);
dini_IntSet(file, "Dyzeline", VehicleInfo[playerid][Dyzeline]=1);
Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 196.9075,-264.8788,1.3181,271.7654, 1, 1, 3600000);
format(string, sizeof(string), "Ruoљiama jūsų maљina %i.", veh);
SendClientMessage(playerid, 0xAFAFAFAA, string);
VehicleInfo[playerid][Model] = GetVehicleModel(veh);
VehicleInfo[playerid][Price] = CarPrice[veh];
VehicleInfo[playerid][CarX] = 2130.1914;
VehicleInfo[playerid][CarY] = -1109.5881;
VehicleInfo[playerid][CarZ] = 25.1890;
VehicleInfo[playerid][CarRot] = 76.2599;
gPlayerHasCar[playerid] = 1;
OwnerID[Vehicle[playerid]] = playerid;
VehPlate[Vehicle[playerid]] = "XYZR 000";
RemovePlayerFromVehicle(playerid);
GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
}
else if(money < CarPrice[veh])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, "[LRG6]: Turi per maћai pinigų.");
return 1;
}
}
else if(gPlayerHasCar2[playerid] == 0)
{
new file2[256], name2[MAX_PLAYER_NAME], string2[64];
GetPlayerName(playerid, name2, sizeof(name2));
format(file2,sizeof(file2),"Cars/%s2.ini",name2);
new veh2 = GetPlayerVehicleID(playerid);
new money2 = GetPlayerMoney(playerid);
if(money2 >= CarPrice[veh2])
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
dini_Create(file2);
GetPlayerName(playerid, name2, 26);
format(file2,sizeof(file2),"Cars/%s2.ini",name2);
dini_IntSet(file2, "Model2", VehicleInfo2[playerid][Model2]);
dini_IntSet(file2, "Price2", VehicleInfo2[playerid][Price2]);
dini_FloatSet(file2, "Rot2", VehicleInfo2[playerid][CarRot2]);
dini_IntSet(file2, "Locked2", VehicleInfo2[playerid][Locked2]);
dini_IntSet(file2, "mod12", VehicleInfo2[playerid][mod12]=0);
dini_IntSet(file2, "mod22", VehicleInfo2[playerid][mod22]=0);
dini_IntSet(file2, "mod32", VehicleInfo2[playerid][mod32]=0);
dini_IntSet(file2, "mod42", VehicleInfo2[playerid][mod42]=0);
dini_IntSet(file2, "mod52", VehicleInfo2[playerid][mod52]=0);
dini_IntSet(file2, "mod62", VehicleInfo2[playerid][mod62]=0);
dini_IntSet(file2, "mod72", VehicleInfo2[playerid][mod72]=0);
dini_IntSet(file2, "mod82", VehicleInfo2[playerid][mod82]=0);
dini_IntSet(file2, "mod92", VehicleInfo2[playerid][mod92]=0);
dini_IntSet(file2, "mod102", VehicleInfo2[playerid][mod102]=0);
dini_IntSet(file2, "mod112", VehicleInfo2[playerid][mod112]=0);
dini_IntSet(file2, "mod122", VehicleInfo2[playerid][mod122]=0);
dini_IntSet(file2, "mod132", VehicleInfo2[playerid][mod132]=0);
dini_IntSet(file2, "mod142", VehicleInfo2[playerid][mod142]=0);
dini_IntSet(file2, "mod152", VehicleInfo2[playerid][mod152]=0);
dini_IntSet(file2, "mod162", VehicleInfo2[playerid][mod162]=0);
dini_IntSet(file2, "mod172", VehicleInfo2[playerid][mod172]=0);
dini_IntSet(file2, "paintjob2", VehicleInfo2[playerid][paintjob2]=0);
dini_IntSet(file2, "color12", VehicleInfo2[playerid][colora2]=1);
dini_IntSet(file2, "color22", VehicleInfo2[playerid][colorb2]=1);
dini_IntSet(file2, "Benzinine2", VehicleInfo2[playerid][Benzinine2]=0);
dini_IntSet(file2, "Dyzeline2", VehicleInfo2[playerid][Dyzeline2]=1);
Vehicle2[playerid] = CreateVehicle(GetVehicleModel(veh2), 196.9075,-264.8788,1.3181,271.7654, 1, 1, 3600000);
format(string2, sizeof(string2), "Ruoљiama jūsų maљina %i.", veh2);
SendClientMessage(playerid, 0xAFAFAFAA, string2);
VehicleInfo2[playerid][Model2] = GetVehicleModel(veh2);
VehicleInfo2[playerid][Price2] = CarPrice[veh2];
VehicleInfo2[playerid][CarX2] = 2130.1914;
VehicleInfo2[playerid][CarY2] = -1109.5881;
VehicleInfo2[playerid][CarZ2] = 25.1890;
VehicleInfo2[playerid][CarRot2] = 76.2599;
gPlayerHasCar2[playerid] = 1;
OwnerID2[Vehicle2[playerid]] = playerid;
VehPlate2[Vehicle2[playerid]] = "XYZR 000";
RemovePlayerFromVehicle(playerid);
GivePlayerMoney(playerid, -VehicleInfo2[playerid][Price2]);
}
else if(money2 < CarPrice[veh2])
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xAFAFAFAA, "[LRG6]: Turi per maћai pinigų.");
return 1;
}
}
else if(gPlayerHasCar2[playerid] == 1)
{
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
if(response == 0)
{
RemovePlayerFromVehicle(playerid);
}
}