21.11.2016, 00:06
Estou fazendo um simples comando com easyDialog, mas estб dando um erro que eu jб tentei resolver de diversas formas (nгo foram todas as formas ¬¬')
Code:
Dialog Response
O erro se encontra no return 1;
Eu tirei o return 1 e deu erro.
Eu coloquei o return 0 (erro) pra ver o que acontecia, e continuou Invalid Function or Declaration.
Code:
PHP Code:
CMD:oficina(playerid, params[])
{
new vehicleid = GetNearestVehicle(playerid);
if(PlayerData[playerid][pJob] != JOB_MECHANIC || !IsDoorVehicle(vehicleid))
return SendErrorMessage(playerid, "Vocк nгo й um mecвnico ou este veнculo nгo pode ser modificado.");
if(!IsPlayerInRangeOfPoint(playerid, 2.0, 1985.4850,-2148.5571,15.4306))
return SendErrorMessage(playerid, "Vocк nгo estб em uma oficina.");
if(vehicleid == INVALID_VEHICLE_ID)
return SendErrorMessage(playerid, "Vocк nгo estб prуximo de nenhum veнculo.");
if(IsPlayerInAnyVehicle(playerid))
return SendErrorMessage(playerid, "Vocк deve sair do veнculo primeiro.");
Dialog_Show(playerid, MechanicOffice, DIALOG_STYLE_TABLIST_HEADERS, "Mesa de Trabalho - Mecвnicos", "Item\tPreзo (Peзas)\n\
Adicionar Rodas\t260\n\
Adicionar NOS\t30\n\
Reparar Motor\t600\n\
Reparar Lataria\t600\n\
Adicionar som automotivo\t3000\n\
Remover Modificaзхes\tGrбtis\n\
Adicionar Hidrбulica\t200", "Selecionar", "Cancelar");
return 1;
}
PHP Code:
Dialog:MechanicOffice(playerid, response, listitem, inputtext[])
{
new vehicleid = GetNearestVehicle(playerid);
if (response)
{
switch(listitem)
{
case 0:
ShowModelSelectionMenu(playerid, "Trocar Rodas", MODEL_SELECTION_WHEELS, {1025, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1096, 1097, 1098}, 17, 0.0, 0.0, 90.0);
case 1:
AddVehicleComponent(vehicleid, 1010);
case 2:
SetVehicleHealth(vehicleid, 1000);
case 3:
RepairVehicle(vehicleid);
case 4:
switch(GetVehicleModel(vehicleid))
{
case 496:
{
new caixablista = CreateObject(2232,0,0,-1000,0,0,0,100);
new caixablista2 = CreateObject(2232,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(caixablista, vehicleid, 0.005000,-1.520000,0.000000,-35.100002,90.539985,0.000000);
AttachObjectToVehicle(caixablista2, vehicleid, 0.005000,-1.520000,0.000000,-145.079940,90.539985,180.899887);
SendClientMessage(playerid, COLOR_CLIENT, "INFORMAЗГO: {FFFFFF}Vocк adicionou uma caixa de som ao seu Blista Compact.");
}
case 400:
{
new caixalandstal = CreateObject(2232,0,0,-1000,0,0,0,100);
new caixalandstal2 = CreateObject(2232,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(caixalandstal, vehicleid, -0.094999,-1.575000,0.119999,0.000000,90.359977,0.000001);
AttachObjectToVehicle(caixalandstal2, vehicleid, -0.094999,-1.575000,0.119999,0.000000,270.000030,0.180020);
SendClientMessage(playerid, COLOR_CLIENT, "INFORMAЗГO: {FFFFFF}Vocк adicionou uma caixa de som ao seu Landstalker.");
}
case 404:
{
new caixaperrenial = CreateObject(2232,0,0,-1000,0,0,0,100);
new caixaperrenial2 = CreateObject(2232,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(caixaperrenial, vehicleid, 0.000000,-2.060000,0.215000,0.000000,90.179985,0.000000);
AttachObjectToVehicle(caixaperrenial2, vehicleid, 0.000000,-2.060000,0.215000,0.000000,-90.719985,0.000000);
SendClientMessage(playerid, COLOR_CLIENT, "INFORMAЗГO: {FFFFFF}Vocк adicionou uma caixa de som ao seu Perrenial.");
}
default:
{
SendErrorMessage(playerid, "Este veнculo nгo suporta uma caixa de som.");
}
}
case 5:
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
}
case 6:
AddVehicleComponent(vehicleid, 1087);
}
}
}
return 1;
}
Eu tirei o return 1 e deu erro.
Eu coloquei o return 0 (erro) pra ver o que acontecia, e continuou Invalid Function or Declaration.