SA-MP Forums Archive
[Ajuda] Problemas ao tunar o carro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problemas ao tunar o carro (/showthread.php?tid=448331)



Problemas ao tunar o carro - LucasThrash - 04.07.2013

Sempre que entro na oficina pra tunar, ou uso o comando /tunar e modifico o carro, instantaneamente o jogo trava totalmente! Peзo que se alguem for me ajudar, nгo postar sу a correзгo dos cуdigos, mas sim tambйm explicar o que foi mudado e o pq... (Quero aprender tambйm rs)

Aseguir os cуdigos relacionados ao Tuning

Код:
#define tunar       21
#define tunarroda   22
#define tunarcor    23
#define tunarpaint  24
Код:
new Menu:Tunar;
new Menu:Paintjobs;
Код:
if (strcmp("/tunar", cmdtext, true, 10) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == drift || dini_Int(file, "VIP") == 1 || dini_Int(file, "aAdmin") == 1 ){
ShowPlayerDialog(playerid, tunar, DIALOG_STYLE_LIST, "Tuning Menu", "Rodas\nCores\nPaintjobs\nNitro\nSuspensгo\nAutoTuning", "OK", "Cancelar");
return 1;
}
}

if(strcmp(cmd, "/pintar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == drift || dini_Int(file, "VIP") == 1  || dini_Int(file, "aAdmin") == 1 ){
new tmp[256];
new cor1,cor2;
new veiculo;
tmp = strtok(cmdtext,idx);
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]");
return 1;
}
Код:
if(dialogid == tunar) // Menu
{
if(response)
{
if(listitem == 0) // Rodas
{
ShowPlayerDialog(playerid, tunarroda, DIALOG_STYLE_LIST, "Rodas", "Roda 1 \nRoda 2 \nRoda 3 \nRoda 4 \nRoda 5 \nRoda 6 \nVoltar", "Instalar", "Cancelar");
TogglePlayerControllable(playerid, 0);
}
if(listitem == 1) // Cores
{
ShowPlayerDialog(playerid, tunarcor, DIALOG_STYLE_LIST, "Cores", "Preto \nBranco \nAzul Escuro \nAzul Claro \nVerde \nVermelho \nAmarelo \nRosa \nVoltar", "Pintar", "Cancelar");
TogglePlayerControllable(playerid, 0);
}
if(listitem == 2) // Paintjobs
{
ShowPlayerDialog(playerid, tunarpaint, DIALOG_STYLE_LIST, "Paintjobs", "Estilo 1 \nEstilo 2 \nEstilo 3 \nVoltar", "Pintar", "Cancelar");
TogglePlayerControllable(playerid, 0);
}
if(listitem == 3) // Nitro
{
AddVehicleComponent(car,1010);
TogglePlayerControllable(playerid, 1);
}
if(listitem == 4) // Suspensгo
{
AddVehicleComponent(car,1087);
TogglePlayerControllable(playerid, 1);
}
Код:
if(dialogid == tunarroda) // Rodas
{
if(response)
{
if(listitem == 0) // Estilo 1
{
AddVehicleComponent(car,1084);
}
if(listitem == 1) // Estilo 2
{
AddVehicleComponent(car,1073);
}
if(listitem == 2) // Estilo 3
{
AddVehicleComponent(car,1075);
}
if(listitem == 3) // Estilo 4
{
AddVehicleComponent(car,1077);
}
if(listitem == 4) // Estilo 5
{
AddVehicleComponent(car,1079);
}
if(listitem == 5) // Estilo 6
{
AddVehicleComponent(car,1080);
}
if(listitem == 6) // Voltar
{
ShowPlayerDialog(playerid, tunar, DIALOG_STYLE_LIST, "Tuning Menu", "Rodas\nCores\nPaintjobs\nNitro\nSuspensгo\nAutoTuning", "Instalar", "Cancelar");
TogglePlayerControllable(playerid, 1);
}
}
return 1;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~======
if(dialogid == tunarcor) // Cores
{
if(response)
{
if(listitem == 0) // Preto
{
ChangeVehicleColor(car,0,0);
}
if(listitem == 1) // Branco
{
ChangeVehicleColor(car,1,1);
}
if(listitem == 2) // Azul Escuro
{
ChangeVehicleColor(car,425,425);
}
if(listitem == 3) // Azul Claro
{
ChangeVehicleColor(car,2,2);
}
if(listitem == 4) // Verde
{
ChangeVehicleColor(car,16,16);
}
if(listitem == 5) // Vermelho
{
ChangeVehicleColor(car,3,3);
}
if(listitem == 6) // Amarelo
{
ChangeVehicleColor(car,6,6);
}
if(listitem == 7) // Rosa
{
ChangeVehicleColor(car,146,146);
}
if(listitem == 8) // Voltar
{
ShowPlayerDialog(playerid, tunar, DIALOG_STYLE_LIST, "Tuning Menu", "Rodas\nCores\nPaintjobs\nNitro\nSuspensгo\nAutoTuning", "Pintar", "Cancelar");
TogglePlayerControllable(playerid, 1);
}
}
return 1;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~======
// radio bcr http://live.hunterfm.com:8080/
if(dialogid == tunarpaint) // Paintjobs
{
if(response)
{
if(listitem == 0) // Estilo 1
{
ChangeVehiclePaintjob(car,0);
}
if(listitem == 1) // Estilo 2
{
ChangeVehiclePaintjob(car,1);
}
if(listitem == 2) // Estilo 3
{
ChangeVehiclePaintjob(car,2);
}
if(listitem == 4) // Voltar
{
ShowPlayerDialog(playerid, tunar, DIALOG_STYLE_LIST, "Tuning Menu", "Rodas\nCores\nPaintjobs\nNitro\nSuspensгo\nAutoTuning", "Pintar", "Cancelar");
TogglePlayerControllable(playerid, 1);
}
}


if(dialogid == NEON)
{
if(response)
{
if(listitem == 0)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "blue", CreateObject(18648,0,0,0,0,0,0));
SetPVarInt(playerid, "blue1", CreateObject(18648,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "blue"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "blue1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "[BVC] ~w~Neon ~b~Azul ~w~ativo.",3500,5);
}
if(listitem == 1)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "green", CreateObject(18649,0,0,0,0,0,0));
SetPVarInt(playerid, "green1", CreateObject(18649,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "green"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "green1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "[BVC] ~~w~Neon ~g~Verde ~w~ativo.",3500,5);
}
if(listitem == 2)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "yellow", CreateObject(18650,0,0,0,0,0,0));
SetPVarInt(playerid, "yellow1", CreateObject(18650,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "yellow"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "yellow1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "[BVC] ~w~Neon ~y~Amarelo ~w~ativo.",3500,5);
}
if(listitem == 3)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "white", CreateObject(18652,0,0,0,0,0,0));
SetPVarInt(playerid, "white1", CreateObject(18652,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "white"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "white1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "[BVC] ~w~Neon Branco ~w~ativo.",3500,5);
}
if(listitem == 4)
{
SetPVarInt(playerid, "neon", 1);
SetPVarInt(playerid, "pink", CreateObject(18651,0,0,0,0,0,0));
SetPVarInt(playerid, "pink1", CreateObject(18651,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "pink"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "pink1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "[BVC] ~w~Neon ~p~Roxo ~w~ativo.",3500,5);
}
if(listitem == 5)
{
DestroyObject(GetPVarInt(playerid, "blue"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "blue1"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "green"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "green1"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "yellow"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "yellow1"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "white"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "white1"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "pink"));
DeletePVar(playerid, "neon");
DestroyObject(GetPVarInt(playerid, "pink1"));
DeletePVar(playerid, "neon");
GameTextForPlayer(playerid, "~r~ Neon desligado.",3500,5);
}
}
}
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:current;
current = GetPlayerMenu(playerid);
new Menu:Current;
Current = GetPlayerMenu(playerid);

if(Current == TuningMenu) {
TogglePlayerControllable(playerid, 0);
switch(row){
case 0:	ShowMenuForPlayer(Paintjobs, playerid);
case 1:	ShowMenuForPlayer(Colors, playerid);
case 2: ShowMenuForPlayer(Exhausts, playerid);
case 3:ShowMenuForPlayer(Frontbumper, playerid);
case 4:ShowMenuForPlayer(Rearbumper, playerid);
case 5:ShowMenuForPlayer(Roof, playerid);
case 6:ShowMenuForPlayer(Spoilers, playerid);
case 7:ShowMenuForPlayer(Sideskirts, playerid);
case 8:ShowMenuForPlayer(Bullbars, playerid);
case 9:ShowMenuForPlayer(Wheels, playerid);
case 10:ShowMenuForPlayer(Carstereo, playerid);
case 11:ShowMenuForPlayer(TuningMenu1, playerid);
}
}
if(Current == Paintjobs) {
switch(row){
case 0:
if(pmodelid[playerid] == 562 ||
pmodelid[playerid] == 565 ||
pmodelid[playerid] == 559 ||
pmodelid[playerid] == 561 ||
pmodelid[playerid] == 560 ||
pmodelid[playerid] == 575 ||
pmodelid[playerid] == 534 || // Broadway
pmodelid[playerid] == 567 ||
pmodelid[playerid] == 536 ||
pmodelid[playerid] == 535 ||
pmodelid[playerid] == 576 ||
pmodelid[playerid] == 558)
{
if(GetPlayerGrana(playerid) < 0){
SendClientMessage(playerid,COLOR_RED,"Vocк nгo tem dinheiro!(R$0)");
ShowMenuForPlayer(TuningMenu, playerid);
TogglePlayerControllable(playerid, 0);
return 1;
}
Acho que esses sгo os principais cуdigos ligados ao tuning... Me ajudem por favor, preciso arrumar isso urgente...

Abraзos


Re: Problemas ao tunar o carro - LucasThrash - 05.07.2013

up alguem?