Portal SAMP
[Ajuda] Como fazer apenas admins usar um comando. - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Como fazer apenas admins usar um comando. (/showthread.php?tid=1652)



Como fazer apenas admins usar um comando. - mitchu - 22/09/2021

Pessoal, alguém pode me ajudar? Tenho esse FS aqui que baixei do Youtube, porém tenho o seguinte problema: o comando "/editarconse" pode ser feito por qualquer usuário e eu queria mudar isso, setar para apenas admins utilizarem o comando, se alguém puder me ajudar, agradeço. Já tentei adaptar os comandos restrito a admins de outras partes da GM mas não consegui.
O código:




Código:
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <DOF2>
#include <sscanf2>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Tecent");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Creditos Criador: Cromartie");
print(" Creditos Vazador: Tecent");
print("----------------------------------\n");
}

#endif

#pragma disablerecursion

#define SvcPATH "CarrosSalvos"
#define Dial_conseTX 9577
#define Diag_Menu_Car Dial_conseTX+1
#define NIDConseCarsC1 Dial_conseTX+2
#define NIDConseCarsC3 Dial_conseTX+3
#define NIDConseCarsC2 Dial_conseTX+4
#define NIDConseCarsC5 Dial_conseTX+5
#define NIDConseCSell  Dial_conseTX+6
#define NIDConseCor  Dial_conseTX+7
#define SellCarPlyPly Dial_conseTX+8
#define QntSlotCar 8
#define SvMaxCarsNormal  60
#define SvMaxCarsMoto    12
#define SvMaxCarsLuxo    30

#define Diag_ConfigCs1 Dial_conseTX+100
#define Diag_ConfigCs2 Dial_conseTX+10
#define Diag_ConfigCs3 Dial_conseTX+11
#define Diag_VerCarros Dial_conseTX+12
#define Diag_CentralConse Dial_conseTX+13
#define Diag_BuySlot Dial_conseTX+14

new const SvC_InfCor[][] = {
{0,"Preto"},
{1,"Branco"},
{425,"Azul Escuro"},
{2,"Azul Claro"},
{16,"Verde"},
{3,"Vermelho"},
{6,"Amarelo"},
{146,"Rosa"},
{11,"Cinza Claro"},
{13,"Cinza Escuro"},
{147,"Ciano"},
{186,"Roxo"},
{30,"Marrom"},
{61,"Beje"}
};

new const Float:SvSpwCarPopular[][] = {
{2117.1497,-1175.9387,29.6230,3.9106}, // spawn carro
{2124.7104,-1175.9521,29.6098,1.8684}, // spawn carro
{2149.2649,-1133.8062,25.4029,269.1623}, // spawn carro
{2149.1790,-1138.4091,25.3285,270.5472}, // spawn carro
{2148.7749,-1143.2344,24.8076,267.9621}, // spawn carro
{2147.7395,-1148.0642,24.2792,268.5703} // spawn carro
};

new const Float:SvSpwCarMOtos[][] = {
{2163.3811,-1197.1633,23.5041,269.8400}, // spawn moto
{2163.3708,-1192.5355,23.3934,269.3736}, // spawn moto
{2163.0808,-1187.7820,23.3932,268.3868}, // spawn moto
{2163.2727,-1182.5414,23.3987,269.9992} // spawn moto
};

new const Float:SvSpwCarLuxo[][] = {
{-1989.5464,275.1058,35.0101,88.1825},// spawn carros vip
{-1989.7297,271.4275,35.0117,85.2402},// spawn carros vip
{-1990.9785,266.4112,35.0066,84.4094},// spawn carros vip
{-1990.5739,263.0913,35.0141,85.2509},// spawn carros vip
{-1990.2383,258.8920,35.0163,84.7425},// spawn carros vip
{-1991.3180,255.6785,35.0079,83.9614},// spawn carros vip
{-1992.1938,252.3230,35.0080,82.8651},// spawn carros vip
{-1992.1395,248.8277,35.0078,86.3387},// spawn carros vip
{-1992.7028,246.1613,35.0081,82.5522},// spawn carros vip
{-1993.0155,242.4098,35.0078,87.4276}// spawn carros vip
};

new SvC_SlotsBy[] ={1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000};
new bool:SvC_BuySlotOnOff = false;  //TRUE = ATIVADO/FALASE = DESATIVADO [SISTEMA DE COMPRAR SLOTS PARA PODER COMPRAR OS VEICULOS NA CONSE]
new SVCarPLAYER[QntSlotCar][MAX_PLAYERS],SvCarCOR[QntSlotCar][MAX_PLAYERS],VisuCAr[MAX_PLAYERS],ConseDoVis[MAX_PLAYERS];
new SVC_Localizar[MAX_PLAYERS],SvSelcCar[MAX_PLAYERS],pAceitar[MAX_PLAYERS][3],pTrancarCAR[MAX_VEHICLES],SvC_UpSlot[MAX_PLAYERS],
TrValorVehNormal[SvMaxCarsNormal][2],TrValorVehMotos[SvMaxCarsMoto][2],TrValorVehLUXO[SvMaxCarsLuxo][2],TrConfConse1[MAX_PLAYERS],TrConfConse2[MAX_PLAYERS];

new SvCNomeCars[][] ={
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel","Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
    "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam","Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus","Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",  "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
    "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",    "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",    "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
    "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",    "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
    "Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",    "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
    "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",    "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
    "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",    "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",  "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",  "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",    "Tiller", "Utility Trailer"
};

public OnGameModeInit()
{
//---------------------------------------------------------------------------------------
    CreateDynamic3DTextLabel("Concessionária\nVeiculos Populares\n/conse ", 0x666699FF, 2134.5073,-1155.5154,24.2175, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
    CreateDynamicMapIcon(2134.5073,-1155.5154,24.2175, 55, -1, -1, -1, -1, 10000);
    CreateDynamicPickup(1239,1,2134.5073,-1155.5154,24.2175, -1, -1, -1, STREAMER_PICKUP_SD, -1, 0);
    CreateDynamic3DTextLabel("Concessionária\nDe Motos\n/conse ", 0x666699FF, 2137.8337,-1155.5135,24.2175, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
    CreateDynamicMapIcon(2137.8337,-1155.5135,24.2175, 55, -1, -1, -1, -1, 10000);
    CreateDynamicPickup(1239,1,2137.8337,-1155.5135,24.2175, -1, -1, -1, STREAMER_PICKUP_SD, -1, 0);
    CreateDynamic3DTextLabel("Concessionária\nVeiculos de Luxo\n/conse ", 0x666699FF, -1968.4557,294.0216,35.1719, 30, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 30.0);
    CreateDynamicMapIcon(-1968.4557,294.0216,35.1719, 55, -1, -1, -1, -1, 10000);
    CreateDynamicPickup(1239,1,-1968.4557,294.0216,35.1719, -1, -1, -1, STREAMER_PICKUP_SD, -1, 0);

new StrSv[128], StrPath[64];
format(StrPath,sizeof(StrPath),"%s/CarPopular.ini",SvcPATH);
    for(new i = 0; i < SvMaxCarsNormal; i++)
{
        format(StrSv, sizeof(StrSv), "Modelo_%i",i);
TrValorVehNormal[i][1] = DOF2_GetInt(StrPath,StrSv);
format(StrSv, sizeof(StrSv), "Valor_%i",i);
TrValorVehNormal[i][0] = DOF2_GetInt(StrPath,StrSv);
    }
    format(StrPath,sizeof(StrPath),"%s/CarMotos.ini",SvcPATH);
    for(new i = 0; i < SvMaxCarsMoto; i++)
{
        format(StrSv, sizeof(StrSv), "Modelo_%i",i);
TrValorVehMotos[i][1] = DOF2_GetInt(StrPath,StrSv);
format(StrSv, sizeof(StrSv), "Valor_%i",i);
TrValorVehMotos[i][0] = DOF2_GetInt(StrPath,StrSv);
    }
    format(StrPath,sizeof(StrPath),"%s/CarLUXO.ini",SvcPATH);
    for(new i = 0; i < SvMaxCarsLuxo; i++)
{
        format(StrSv, sizeof(StrSv), "Modelo_%i",i);
TrValorVehLUXO[i][1] = DOF2_GetInt(StrPath,StrSv);
format(StrSv, sizeof(StrSv), "Valor_%i",i);
TrValorVehLUXO[i][0] = DOF2_GetInt(StrPath,StrSv);
    }
new cfrdasf;

return 1;
}

public OnGameModeExit()
{
DOF2_Exit();
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
new Svcpath[50];
Svcpath = SaveCarNomePlay(playerid);
if(DOF2_FileExists(Svcpath)) SvC_UpSlot[playerid] = DOF2_GetInt(Svcpath,"SvC_UpSlot");
RemoveBuildingForPlayer(playerid, 5632, 2161.0800, -1131.6800, 31.1172, 0.10); // motelalpha
RemoveBuildingForPlayer(playerid, 1493, 2112.0500, -1211.0300, 22.9375, 0.10); // Gen_doorSHOP01
RemoveBuildingForPlayer(playerid, 1308, 2120.8000, -1211.8000, 23.2343, 0.10); // telgrphpole02
RemoveBuildingForPlayer(playerid, 5414, 2112.7299, -1178.4699, 27.3358, 0.10); // laeJeffers02
RemoveBuildingForPlayer(playerid, 5468, 2112.7299, -1178.4699, 27.3358, 0.10); // LOD Model of laeJeffers02
RemoveBuildingForPlayer(playerid, 956, 2139.5200, -1161.4799, 23.3593, 0.10); // CJ_EXT_CANDY
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    SVC_Localizar[playerid] = 0;
    ConseDoVis[playerid] = 0;
    for (new i = 0; i < QntSlotCar; i++)
{
    DestroyVehicle(SVCarPLAYER[i][playerid]);
    SVCarPLAYER[i][playerid] = 0;
    }
new Svcpath[50];
Svcpath = SaveCarNomePlay(playerid);
if(!DOF2_FileExists(Svcpath)) DOF2_CreateFile(Svcpath);
DOF2_SetInt(Svcpath,"SvC_UpSlot",SvC_UpSlot[playerid]);
SvC_UpSlot[playerid] = 0;
return 1;
}

SaveCarNomePlay(playerid){
new name[24], full[50];
GetPlayerName(playerid,name,sizeof(name));
format(full,sizeof(full),"%s/%s.txt",SvcPATH,name);
return full;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Diag_CentralConse){
        if(response){
            new StrScv[128];
            if(listitem == 0){
    if(IsPlayerInRangeOfPoint(playerid,2.0,2134.5073,-1155.5154,24.2175)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehNormal); i++){
    if(TrValorVehNormal[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\t%s\n",SvCNomeCars[TrValorVehNormal[i][1]-400],TrValorVehNormal[i][1],TrValorVehNormal[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Dial_conseTX, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos", ScStrG, "Comprar", "Voltar");
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,2137.8337,-1155.5135,24.2175)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehMotos); i++){
    if(TrValorVehMotos[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\t%s\n",SvCNomeCars[TrValorVehMotos[i][1]-400],TrValorVehMotos[i][1],TrValorVehMotos[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Dial_conseTX, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos", ScStrG, "Comprar", "Voltar");
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,-1968.4557,294.0216,35.1719)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehLUXO); i++){
    if(TrValorVehLUXO[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\n",SvCNomeCars[TrValorVehLUXO[i][1]-400],TrValorVehLUXO[i][1],TrValorVehLUXO[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Dial_conseTX, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos", ScStrG, "Comprar", "Voltar");
    }else SendClientMessage(playerid, 0xFF0000FF, "Você não está em uma conse!");
            }else if(listitem == 1){
    if(IsPlayerInRangeOfPoint(playerid,2.0,2134.5073,-1155.5154,24.2175)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehNormal); i++){
    if(TrValorVehNormal[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\t%s\n",SvCNomeCars[TrValorVehNormal[i][1]-400],TrValorVehNormal[i][1],TrValorVehNormal[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Diag_VerCarros, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos [Visualizar]", ScStrG, "Ver", "Voltar");
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,2137.8337,-1155.5135,24.2175)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehMotos); i++){
    if(TrValorVehMotos[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\t%s\n",SvCNomeCars[TrValorVehMotos[i][1]-400],TrValorVehMotos[i][1],TrValorVehMotos[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Diag_VerCarros, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos [Visualizar]", ScStrG, "Ver", "Voltar");
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,-1968.4557,294.0216,35.1719)){
        new ScStrG[3500];
//xt strcat(ScStrG, "{666699}Modelo\t{666699}Valor\n{FFFFFF}");
for(new i = 0; i < sizeof(TrValorVehLUXO); i++){
    if(TrValorVehLUXO[i][1] >= 400){
format(StrScv, sizeof(StrScv), "%s(%i)\tR$%i\n",SvCNomeCars[TrValorVehLUXO[i][1]-400],TrValorVehLUXO[i][1],TrValorVehLUXO[i][0]);
strcat(ScStrG, StrScv);
}else break;
}
return ShowPlayerDialog(playerid, Diag_VerCarros, DIALOG_STYLE_LIST, "{666699}Concessionária de veiculos [Visualizar]", ScStrG, "Ver", "Volta");
    }else SendClientMessage(playerid, 0xFF0000FF, "Você não está em uma conse!");
            }
        }
        return 1;
}
    if(dialogid == Diag_VerCarros){
        if(response){
                new StrSv[128];
    if(IsPlayerInRangeOfPoint(playerid,2.0,2134.5073,-1155.5154,24.2175)){
        ConseDoVis[playerid] = 1;
                    VisuCAr[playerid] = AddStaticVehicleEx(TrValorVehNormal[listitem][1],2119.8101,-1198.1276,25.4969,17.9203,1,1,-1);
                    format(StrSv, sizeof(StrSv), "Você está visualizando o veiculo %s(%i) por 10 Seg ou saia do carro!",SvCNomeCars[TrValorVehNormal[listitem][1]-400],TrValorVehLUXO[listitem][1]);
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,2137.8337,-1155.5135,24.2175)){
        ConseDoVis[playerid] = 2;
                    VisuCAr[playerid] = AddStaticVehicleEx(TrValorVehMotos[listitem][1],2119.8101,-1198.1276,25.4969,17.9203,1,1,-1);
                    format(StrSv, sizeof(StrSv), "Você está visualizando o veiculo %s(%i) por 10 Seg ou saia do carro!",SvCNomeCars[TrValorVehMotos[listitem][1]-400],TrValorVehLUXO[listitem][1]);
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,-1968.4557,294.0216,35.1719)){
        ConseDoVis[playerid] = 3;
                    VisuCAr[playerid] = AddStaticVehicleEx(TrValorVehLUXO[listitem][1],2119.8101,-1198.1276,25.4969,17.9203,1,1,-1);
                    format(StrSv, sizeof(StrSv), "Você está visualizando o veiculo %s(%i) por 10 Seg ou saia do carro!",SvCNomeCars[TrValorVehLUXO[listitem][1]-400],TrValorVehLUXO[listitem][1]);
    }
                SetVehicleVirtualWorld(VisuCAr[playerid], playerid+1);
                SetPlayerVirtualWorld(playerid, playerid+1);
                PutPlayerInVehicle(playerid, VisuCAr[playerid], 1);
                SetTimerEx("VisuCarFx", 10000, false,"i",playerid);
                SendClientMessage(playerid, 0x666699FF, StrSv);
        }else SvcShowDialgC(playerid);
        return 1;
    }
    if(dialogid == Diag_ConfigCs1){
        if(response){
TrConfConse1[playerid] = listitem;
new ScStrG[3000],StrSv[128];
//rt strcat(ScStrG, "{666699}Slot\t{666699}Veiculo\t{666699}Valor\n");
if(listitem == 0){
for(new i = 0; i < sizeof(TrValorVehNormal); i++){
    if(TrValorVehNormal[i][1] >= 400)
format(StrSv, sizeof(StrSv), "%i\t%s(%i)\tR$%i\n",i,SvCNomeCars[TrValorVehNormal[i][1]-400],TrValorVehNormal[i][1],TrValorVehNormal[i][0]);
else
format(StrSv, sizeof(StrSv), "%i\tNenhum\n",i);
strcat(ScStrG, StrSv);
}
}
else if(listitem == 1){
for(new i = 0; i < SvMaxCarsMoto; i++){
    if(TrValorVehMotos[i][1] >= 400)
format(StrSv, sizeof(StrSv), "%i\t%s(%i)\tR$%i\n",i,SvCNomeCars[TrValorVehMotos[i][1]-400],TrValorVehMotos[i][1],TrValorVehMotos[i][0]);
else
format(StrSv, sizeof(StrSv), "%i\tNenhum\n",i);
strcat(ScStrG, StrSv);
}
}
else if(listitem == 2){
for(new i = 0; i < SvMaxCarsLuxo; i++){
    if(TrValorVehLUXO[i][1] >= 400)
format(StrSv, sizeof(StrSv), "%i\t%s(%i)\tR$%i\n",i,SvCNomeCars[TrValorVehLUXO[i][1]-400],TrValorVehLUXO[i][1],TrValorVehLUXO[i][0]);
else
format(StrSv, sizeof(StrSv), "%i\tNenhum\n",i);
strcat(ScStrG, StrSv);
}
}
return ShowPlayerDialog(playerid, Diag_ConfigCs2, DIALOG_STYLE_LIST, "{666699}Configurar Concessionária", ScStrG, "proximo", "Cancelar");
}
return 1;
}
    if(dialogid == Diag_ConfigCs2){
        if(response){
TrConfConse2[playerid] = listitem;
new ScStrG[500];
strcat(ScStrG, "{666699}Digite: {FFFFFF}[Modelo][Valor]\n");
strcat(ScStrG, "{666699}Modelos Diponiveis: [400~611]\n");
strcat(ScStrG, "{666699}Digite {FFFFFF}Modelo: [0] {666699}para limpar um Slot\n");
return ShowPlayerDialog(playerid, Diag_ConfigCs3, DIALOG_STYLE_INPUT, "{666699}Configurar Concessionária", ScStrG, "proximo", "Cancelar");
}
return 1;
}
    if(dialogid == Diag_ConfigCs3){
        if(response){
            new xModelo, xValor, xSlot = TrConfConse2[playerid],StrSv[128],StrPath[64];
            if(sscanf(inputtext, "ii", xModelo, xValor)) return SendClientMessage(playerid, 0xFF0000FF, "Digite: [Modelo][Valor]");
            if(xModelo < 400 || xModelo > 611 && xModelo != 0) return SendClientMessage(playerid, 0xFF0000FF, "Modelos validos: [400~611] /ou Modelo: 0 para remover limpar o slot");
if(TrConfConse1[playerid] == 0){
    if(xModelo != 0) format(StrSv, sizeof(StrSv), "Você adiciou o veiculo %s(%i) por R$%i na conse de Carros Populares! [Slot:%i]",SvCNomeCars[xModelo-400],xModelo,xValor,xSlot);
    else format(StrSv, sizeof(StrSv), "Você limpou o Slot: %i!",xSlot);
    TrValorVehNormal[xSlot][1] = xModelo;
    TrValorVehNormal[xSlot][0] = xValor;
    SendClientMessage(playerid, 0xFFFFFFFF, StrSv);
format(StrPath,sizeof(StrPath),"%s/CarPopular.ini",SvcPATH);
}else if(TrConfConse1[playerid] == 1){
    if(xModelo != 0) format(StrSv, sizeof(StrSv), "Você adiciou o veiculo %s(%i) por R$%i na conse de Motos! [Slot:%i]",SvCNomeCars[xModelo-400],xModelo,xValor,xSlot);
    else format(StrSv, sizeof(StrSv), "Você limpou o Slot: %i!",xSlot);
                TrValorVehMotos[xSlot][1] = xModelo;
                TrValorVehMotos[xSlot][0] = xValor;
                SendClientMessage(playerid, 0xFFFFFFFF, StrSv);
                format(StrPath,sizeof(StrPath),"%s/CarMotos.ini",SvcPATH);
}else if(TrConfConse1[playerid] == 2){
    if(xModelo != 0) format(StrSv, sizeof(StrSv), "Você adiciou o veiculo %s(%i) por R$%i na conse de Carros LUXO! [Slot:%i]",SvCNomeCars[xModelo-400],xModelo,xValor,xSlot);
    else format(StrSv, sizeof(StrSv), "Você limpou o Slot: %i!",xSlot);
    TrValorVehLUXO[xSlot][1] = xModelo;
    TrValorVehLUXO[xSlot][0] = xValor;
    SendClientMessage(playerid, 0xFFFFFFFF, StrSv);
    format(StrPath,sizeof(StrPath),"%s/CarLUXO.ini",SvcPATH);
}
if(!DOF2_FileExists(StrPath)) DOF2_CreateFile(StrPath);
format(StrSv, sizeof(StrSv), "Modelo_%i",xSlot);
DOF2_SetInt(StrPath,StrSv,xModelo);
format(StrSv, sizeof(StrSv), "Valor_%i",xSlot);
DOF2_SetInt(StrPath,StrSv,xValor);
DOF2_SaveFile();
}
return 1;
}
    if(dialogid == Diag_Menu_Car){
        if(response){
    if(listitem == 0){
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Voce nao esta em um veiculo!");
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
    if(SVCarPLAYER[i][playerid] != 0){
        new DefCarSlot = GetVehicleModel(SVCarPLAYER[i][playerid]);
        if(DefCarSlot >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i)\n",i, SvCNomeCars[DefCarSlot-400],DefCarSlot);
strcat(StrMV, FtrMV);
}
    }else{
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i)\n",i, SvCNomeCars[SCCarid-400],SCCarid);
}else format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
}
        return ShowPlayerDialog(playerid, NIDConseCarsC1, DIALOG_STYLE_LIST, "{666699}Estacionar Veiculo", StrMV, "Proximo", "Voltar");
    }
    else if(listitem == 1){
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i)\n",i, SvCNomeCars[SCCarid-400],SCCarid);
}else
    format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
                return ShowPlayerDialog(playerid, NIDConseCarsC3, DIALOG_STYLE_LIST, "{666699}Spawnar Veiculo", StrMV, "Proximo", "Voltar");
    }
    else if(listitem == 2){
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i)\n",i, SvCNomeCars[SCCarid-400],SCCarid);
}else
    format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
        return ShowPlayerDialog(playerid, NIDConseCarsC2, DIALOG_STYLE_LIST, "{666699}Localizar Veiculo", StrMV, "Proximo", "Voltar");
    }
    else if(listitem == 3){
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i)\n",i, SvCNomeCars[SCCarid-400],SCCarid);
}else
    format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
                return ShowPlayerDialog(playerid, NIDConseCarsC5, DIALOG_STYLE_LIST, "{666699}Remover Veiculo", StrMV, "Proximo", "Voltar");
    }
    else if(listitem == 4){
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i) {33CC33}R$%i\n",i, SvCNomeCars[SCCarid-400],SCCarid, floatround(yChckVlrCar(SCCarid)));
}else
    format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
                return ShowPlayerDialog(playerid, NIDConseCSell, DIALOG_STYLE_LIST, "{666699}Vender Veiculo", StrMV, "Proximo", "Voltar");
    }
    else if(listitem == 5){
new path[50],StrCAR[24], FtrMV[64],StrMV[1000];
strcat(StrMV, "{00FF00}Digite o numero do veiculo para ser Vendio para outro player\n");
strcat(StrMV, "{00FF00}Digite: [playerid][Slot][Valor]\n");
path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid >= 400){
format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - %s(%i) {33CC33}FIPE: R$%i\n",i, SvCNomeCars[SCCarid-400],SCCarid, floatround(yChckVlrCar(SCCarid)));
}else
    format(FtrMV, sizeof(FtrMV), "{666699}[%i]{FFFFFF} - Nenhum\n",i);
strcat(StrMV, FtrMV);
}
                ShowPlayerDialog(playerid, SellCarPlyPly, DIALOG_STYLE_INPUT, "{666699}Vender Veiculo para outro jogador", StrMV, "Proximo", "Voltar");
        return 1;
    }
    else if(listitem == 6){
new xValor = pAceitar[playerid][0], xPlayer = pAceitar[playerid][1], xSlot = pAceitar[playerid][2], PegarNome[32], ySlot = -1,StrScv[128];
    if(pAceitar[playerid][0] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Voce nao tem nenhuma solicitação de venda de veiculos!");
    if(GetPlayerMoney(playerid) < xValor) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não tem dinheiro suficiente!");
    if(SVCarPLAYER[xSlot][xPlayer] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "O Veiculo do jogador nao esta Spawnado!");
new path[50],StrCAR[24];
path = SaveCarNomePlay(xPlayer);
format(StrCAR, sizeof(StrCAR), "CarID_%i", xSlot);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid < 400) return SendClientMessage(playerid, 0xFFFFFFFF, "Este jogador nao possui mais este Veiculo!");
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
if(DOF2_GetInt(path,StrCAR) == 0){ ySlot = i; break; }
}
if(ySlot == -1) return SendClientMessage(playerid, 0xFF0000FF, "{666699}Voce nao tem Slots suficiente!");
if(SvC_BuySlotOnOff == true) if(ySlot >= SvC_UpSlot[playerid]) return SendClientMessage(playerid, 0xFF0000FF, "Você não possui Slots Sufucientes!");
    GivePlayerMoney(xPlayer,xValor);
    GivePlayerMoney(playerid,-xValor);
        GetPlayerName(xPlayer, PegarNome, sizeof(PegarNome));
format(StrScv, sizeof(StrScv), "Você comprou o veiculo (%s) do %s(%i) por R$%i", SvCNomeCars[SCCarid-400],PegarNome,xPlayer,xValor);
SendClientMessage(playerid, 0xFFFFFFFF, StrScv);
GetPlayerName(playerid, PegarNome, sizeof(PegarNome));
format(StrScv, sizeof(StrScv), "Jogador %s(%i) comprou o seu veiculo (%s) por R$%i", SvCNomeCars[SCCarid-400],PegarNome,playerid,xValor);
SendClientMessage(xPlayer, 0xFFFFFFFF, StrScv);
SVCarPLAYER[ySlot][playerid] = SVCarPLAYER[xSlot][xPlayer];
  path = SaveCarNomePlay(xPlayer);
format(StrCAR, sizeof(StrCAR), "CarID_%i", xSlot);
DOF2_SetInt(path,StrCAR,0);
SVCarPLAYER[xSlot][xPlayer] = 0;
    pAceitar[playerid][0] = 0;//VALOR
    pAceitar[playerid][1] = 0;//PLAYERID
    pAceitar[playerid][2] = 0;//SLOT
    DOF2_SaveFile();
        return 1;
    }
    else if(listitem == 7){
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Você não está em um carro!");
if(pTrancarCAR[GetPlayerVehicleID(playerid)] > 0) return SendClientMessage(playerid, 0xFF0000FF, "Este veiculo já esta trancado!");
pTrancarCAR[GetPlayerVehicleID(playerid)] = playerid+1;
SendClientMessage(playerid, 0xFFFFFFFF, "Veiculo trancado!");
    }
    else if(listitem == 8){
new veiculo = -1,Float:PosCar[3];
for(new i = 0; i < 2000; i++){
    GetVehiclePos(i,PosCar[0],PosCar[1],PosCar[2]);
    if(IsPlayerInRangeOfPoint(playerid,3.0,PosCar[0],PosCar[1],PosCar[2])){ veiculo = i;break;}
}
if(veiculo == -1) return SendClientMessage(playerid, 0xFF0000FF, "Voce nao esta proximo a nenhum veiculo!");
if(pTrancarCAR[veiculo] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Este veiculo nao esta trancado!");
if(pTrancarCAR[veiculo]-1 != playerid) return SendClientMessage(playerid, 0xFF0000FF, "Você não possui as chaves deste veiculo!");
pTrancarCAR[veiculo] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, "Veiculo Destrancado!");
    }else if(listitem == 9){
        new StrMV[1000],StrCAR[128];
            for(new i = 0; i < QntSlotCar; i++){
                format(StrCAR, sizeof(StrCAR), "{FFFFFF}Slot:%i\t{33CC33}R$%i\t%s\n", i,SvC_SlotsBy[i], SvC_UpSlot[playerid] <= i ? ("{E74C3C}[NÃO COMPRADO]"):("{2ECC71}[COMPRADO]"));
strcat(StrMV, StrCAR);
            }
            return ShowPlayerDialog(playerid, Diag_BuySlot, DIALOG_STYLE_LIST, "{FF0000}[Upgrade Slots]", StrMV, "Proximo", "Cancelar");
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Opcao Invalida!");
        return 1;
        }
        return 1;
    }
if(dialogid == Diag_BuySlot){//
    if(!response) return 1;
    new StrScv[128];
            if(listitem != 0) if(SvC_UpSlot[playerid] <= listitem-1) return SendClientMessage(playerid, 0xFF0000FF, "Você não comprou a capacidade anterior!");
            if(SvC_UpSlot[playerid] > listitem) return SendClientMessage(playerid, 0xFF0000FF, "Você já comprou esta capacidade!");
            if(GetPlayerMoney(playerid) < SvC_SlotsBy[listitem]) return SendClientMessage(playerid, 0xFF0000FF, "Você não tem dinheiro suficiente para comprar este Upgrade!");
            GivePlayerMoney(playerid,-SvC_SlotsBy[listitem]);
        SvC_UpSlot[playerid] = listitem+1;
            format(StrScv, sizeof(StrScv), "Você comprou o Slot %i por {33CC33}R$%i", listitem,SvC_SlotsBy[listitem]);
            SendClientMessage(playerid, 0xFFFFFFFF, StrScv);
return 1;
}
if(dialogid == NIDConseCarsC5){
  if(response){
        new SlcCAR = listitem, StrCAR[128],Float:PosV[3];
        if(SlcCAR >= 5) return SendClientMessage(playerid, 0xFF0000AA, "{6495ED}Voce digitou um numero invalido!");
        if(SVCarPLAYER[SlcCAR][playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "{6495ED}Voce nao pegou seu veiculo.");
        if(AlguemNoCarro(SVCarPLAYER[SlcCAR][playerid]) == 1) return SendClientMessage(playerid, 0xFF0000FF,"Tem alguem dentro do seu veiculo!");
                GetVehiclePos(SVCarPLAYER[SlcCAR][playerid],PosV[0],PosV[1],PosV[2]);
                if(!IsPlayerInRangeOfPoint(playerid,20.0,PosV[0],PosV[1],PosV[2])) return SendClientMessage(playerid, 0xFF0000AA, "Voce nao esta perto o suficiente do seu veiculo!");
DestroyVehicle(SVCarPLAYER[SlcCAR][playerid]);
                format(StrCAR, sizeof(StrCAR), "Voce removeu seu veiuclo {666699}(%i)", SlcCAR);
                SendClientMessage(playerid, 0xFFFFFFFF, StrCAR);
                SVCarPLAYER[SlcCAR][playerid] = 0;
        }else SvcShwDiagMenu(playerid);
        TogglePlayerControllable(playerid, true);
        return 1;
}
if(dialogid == NIDConseCarsC3){
  if(response){
        new SlcCAR = listitem;
        if(SlcCAR >= 5) return SendClientMessage(playerid, 0xFF0000FF, "Voce digitou um numero invalido!");
        if(SVCarPLAYER[SlcCAR][playerid] != 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce ja pegou o veiculo deste slot!");
new path[50],StrCAR[64], SCCarid, Float:PosSC[4];
path = SaveCarNomePlay(playerid);
format(StrCAR, sizeof(StrCAR), "CarID_%i", SlcCAR);
SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid < 400) return SendClientMessage(playerid, 0xFF0000FF, "Não possui nenhum veiculo neste Slot!");
format(StrCAR, sizeof(StrCAR), "PosX_%i", SlcCAR);
  PosSC[0] = DOF2_GetFloat(path,StrCAR);
  format(StrCAR, sizeof(StrCAR), "PosY_%i", SlcCAR);
  PosSC[1] = DOF2_GetFloat(path,StrCAR);
  format(StrCAR, sizeof(StrCAR), "PosZ_%i", SlcCAR);
  PosSC[2] = DOF2_GetFloat(path,StrCAR);
  format(StrCAR, sizeof(StrCAR), "PosA_%i", SlcCAR);
  PosSC[3] = DOF2_GetFloat(path,StrCAR);
format(StrCAR, sizeof(StrCAR), "Cor_%i", SlcCAR);
SvCarCOR[SlcCAR][playerid] = DOF2_GetInt(path,StrCAR);
  DestroyVehicle(SVCarPLAYER[SlcCAR][playerid]);
  SVCarPLAYER[SlcCAR][playerid] = AddStaticVehicleEx(SCCarid,PosSC[0],PosSC[1],PosSC[2],PosSC[3],SvCarCOR[SlcCAR][playerid],SvCarCOR[SlcCAR][playerid],-1);
  SetVehicleHealth(SVCarPLAYER[SlcCAR][playerid], 1000.0);
  SendClientMessage(playerid, 0xFFFFFFFF, "Seu veiculo esta no local estacionado.");
        }else SvcShwDiagMenu(playerid);
        TogglePlayerControllable(playerid, true);
        return 1;
}
if(dialogid == NIDConseCarsC2){
  if(response){
        new SlcCAR = listitem;
        if(SlcCAR >= QntSlotCar) return SendClientMessage(playerid, 0xFF0000FF, "Voce digitou um numero invalido!");
        if(SVCarPLAYER[SlcCAR][playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Voce nao pegou seu veiculo.");
        new Float:PosV[3],StrCAR[128];
        GetVehiclePos(SVCarPLAYER[SlcCAR][playerid],PosV[0],PosV[1],PosV[2]);
        if(floatround(PosV[0]) == 0 && floatround(PosV[1]) == 0){
            SVCarPLAYER[SlcCAR][playerid] = 0;
            format(StrCAR, sizeof(StrCAR), "Seu veiculo {666699}(%i){FFFFFF} foi Sincronizado! Pegue novamente", SlcCAR);
            SendClientMessage(playerid, 0xFFFFFFFF, StrCAR);
            return 1;
        }
                SetPlayerCheckpoint(playerid, PosV[0],PosV[1],PosV[2], 6.0);
                format(StrCAR, sizeof(StrCAR), "Voce localizou o seu veiculo {666699}(%i)", SlcCAR);
                SendClientMessage(playerid, 0xFFFFFFFF, StrCAR);
                SVC_Localizar[playerid] = 1;
        }else SvcShwDiagMenu(playerid);
        TogglePlayerControllable(playerid, true);
        return 1;
}
if(dialogid == NIDConseCarsC1){
  if(response){
new SlcCAR = listitem;
new path[50],StrCAR[64], SCCarid, Float:PosSC[4];
    SCCarid = GetPlayerVehicleID(playerid);
if(SCCarid != SVCarPLAYER[SlcCAR][playerid]) return SendClientMessage(playerid, 0xFF0000FF, "Este carro nao e seu, ou nao foi comprado!");
path = SaveCarNomePlay(playerid);
if(!DOF2_FileExists(path)) DOF2_CreateFile(path);
GetVehiclePos(SCCarid, PosSC[0],PosSC[1],PosSC[2]);
GetVehicleZAngle(SCCarid, PosSC[3]);
format(StrCAR, sizeof(StrCAR), "CarID_%i", SlcCAR);
DOF2_SetInt(path,StrCAR,GetVehicleModel(GetPlayerVehicleID(playerid)));
format(StrCAR, sizeof(StrCAR), "PosX_%i", SlcCAR);
DOF2_SetFloat(path,StrCAR,PosSC[0]);
format(StrCAR, sizeof(StrCAR), "PosY_%i", SlcCAR);
DOF2_SetFloat(path,StrCAR,PosSC[1]);
format(StrCAR, sizeof(StrCAR), "PosZ_%i", SlcCAR);
DOF2_SetFloat(path,StrCAR,PosSC[2]);
format(StrCAR, sizeof(StrCAR), "PosA_%i", SlcCAR);
DOF2_SetFloat(path,StrCAR,PosSC[3]);
format(StrCAR, sizeof(StrCAR), "Cor_%i", SlcCAR);
DOF2_SetInt(path,StrCAR,SvCarCOR[SlcCAR][playerid]);
DOF2_SaveFile();
        SendClientMessage(playerid, 0xFF0000FF, "voce estacionou seu carro aqui!");
        }else SvcShwDiagMenu(playerid);
        return 1;
}
if(dialogid == NIDConseCSell){
if(response){
new SlcCAR = listitem,path[50],StrCAR[64],StrMsg[128],pModelo,pValor;
path = SaveCarNomePlay(playerid);
format(StrCAR, sizeof(StrCAR), "CarID_%i", SlcCAR);
pModelo = DOF2_GetInt(path,StrCAR);
if(pModelo < 400) return SendClientMessage(playerid, 0xFF0000FF, "Não possui nenhum veiculo neste Slot!");
pValor = floatround(yChckVlrCar(pModelo));
DOF2_SetInt(path,StrCAR,0);
format(StrMsg, sizeof(StrMsg), "Voce vendeu o veiculo {666699}%s{FFFFFF} por {33CC33}R$%i", SvCNomeCars[pModelo-400],pValor);
SendClientMessage(playerid,0xFFFFFFFF,StrMsg);
GivePlayerMoney(playerid,pValor);
  DestroyVehicle(SVCarPLAYER[SlcCAR][playerid]);
  SVCarPLAYER[SlcCAR][playerid] = 0;
    DOF2_SaveFile();
}else SvcShwDiagMenu(playerid);
return 1;
}
if(dialogid == NIDConseCor){
if(response){
        new StrScv[128],StrCAR[64],path[50],Slot = -1,DefCar = SvSelcCar[playerid], pCor = SvC_InfCor[listitem][0];//
    path = SaveCarNomePlay(playerid);
for(new i = 0; i < QntSlotCar; i++){
format(StrCAR, sizeof(StrCAR), "CarID_%i", i);
if(DOF2_GetInt(path,StrCAR) == 0){ Slot = i; break; }
}
if(Slot == -1) return SendClientMessage(playerid, 0xFF0000FF, "Voce nao tem Slots suficiente!");
if(SvC_BuySlotOnOff == true) if(Slot >= SvC_UpSlot[playerid]) return SendClientMessage(playerid, 0xFF0000FF, "Você não possui Slots Sufucientes!");
if(pCor < 0 || pCor > 255) return SendClientMessage(playerid, 0xFF0000FF, "Use cores de 0~255!");
    if(IsPlayerInRangeOfPoint(playerid,2.0,2134.5073,-1155.5154,24.2175)){//TrValorVehNormal
    if(GetPlayerMoney(playerid) < TrValorVehNormal[DefCar][0]) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não tem dinheiro suficiente!");
    if(TrValorVehNormal[DefCar][1] < 400) return SendClientMessage(playerid, 0xFFFFFFFF, "Não possui nenhum veiculo neste Slot!");
    new XcAlr = random(sizeof(SvSpwCarPopular));
    DestroyVehicle(SVCarPLAYER[Slot][playerid]);
                GivePlayerMoney(playerid,-TrValorVehNormal[DefCar][0]);
SVCarPLAYER[Slot][playerid] = AddStaticVehicleEx(TrValorVehNormal[DefCar][1],SvSpwCarPopular[XcAlr][0],SvSpwCarPopular[XcAlr][1],SvSpwCarPopular[XcAlr][2]+2.0,SvSpwCarPopular[XcAlr][3],pCor,pCor,-1);
        format(StrScv, sizeof(StrScv), "Voce comprou {666699}%s(%i){FFFFFF} por {33CC33}R$%i!",SvCNomeCars[TrValorVehNormal[DefCar][1]-400],TrValorVehNormal[DefCar][1],TrValorVehNormal[DefCar][0]);
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,2137.8337,-1155.5135,24.2175)){//TrValorVehMotos
        if(GetPlayerMoney(playerid) < TrValorVehMotos[DefCar][0]) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não tem dinheiro suficiente!");
        if(TrValorVehMotos[DefCar][1] < 400) return SendClientMessage(playerid, 0xFFFFFFFF, "Não possui nenhum veiculo neste Slot!");
        new XcAlr = random(sizeof(SvSpwCarMOtos));
        DestroyVehicle(SVCarPLAYER[Slot][playerid]);
                GivePlayerMoney(playerid,-TrValorVehMotos[DefCar][0]);
SVCarPLAYER[Slot][playerid] = AddStaticVehicleEx(TrValorVehMotos[DefCar][1],SvSpwCarMOtos[XcAlr][0],SvSpwCarMOtos[XcAlr][1],SvSpwCarMOtos[XcAlr][2]+2.0,SvSpwCarMOtos[XcAlr][3],pCor,pCor,-1);
        format(StrScv, sizeof(StrScv), "Voce comprou {666699}%s(%i){FFFFFF} por {33CC33}R$%i!",SvCNomeCars[TrValorVehMotos[DefCar][1]-400],TrValorVehMotos[DefCar][1],TrValorVehMotos[DefCar][0]);
    }else if(IsPlayerInRangeOfPoint(playerid,2.0,-1968.4557,294.0216,35.1719)){//TrValorVehLUXO
        if(GetPlayerMoney(playerid) < TrValorVehLUXO[DefCar][0]) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não tem dinheiro suficiente!");
        if(TrValorVehLUXO[DefCar][1] < 400) return SendClientMessage(playerid, 0xFFFFFFFF, "Não possui nenhum veiculo neste Slot!");
        new XcAlr = random(sizeof(SvSpwCarLuxo));
        DestroyVehicle(SVCarPLAYER[Slot][playerid]);
                GivePlayerMoney(playerid,-TrValorVehLUXO[DefCar][0]);
SVCarPLAYER[Slot][playerid] = AddStaticVehicleEx(TrValorVehLUXO[DefCar][1],SvSpwCarLuxo[XcAlr][0],SvSpwCarLuxo[XcAlr][1],SvSpwCarLuxo[XcAlr][2]+2.0,SvSpwCarLuxo[XcAlr][3],pCor,pCor,-1);
        format(StrScv, sizeof(StrScv), "Voce comprou {666699}%s(%i){FFFFFF} por {33CC33}R$%i!",SvCNomeCars[TrValorVehLUXO[DefCar][1]-400],TrValorVehLUXO[DefCar][1],TrValorVehLUXO[DefCar][0]);
    }
SvCarCOR[Slot][playerid] = pCor;
        SendClientMessage(playerid, 0xFFFFFFFF, StrScv);
new SCCarid, Float:PosSC[4];
  SCCarid = SVCarPLAYER[Slot][playerid];
path = SaveCarNomePlay(playerid);
if(!DOF2_FileExists(path)) DOF2_CreateFile(path);
GetVehiclePos(SCCarid, PosSC[0],PosSC[1],PosSC[2]);
GetVehicleZAngle(SCCarid, PosSC[3]);
format(StrCAR, sizeof(StrCAR), "CarID_%i", Slot);
DOF2_SetInt(path,StrCAR,GetVehicleModel(SCCarid));
format(StrCAR, sizeof(StrCAR), "PosX_%i", Slot);
DOF2_SetFloat(path,StrCAR,PosSC[0]);
format(StrCAR, sizeof(StrCAR), "PosY_%i", Slot);
DOF2_SetFloat(path,StrCAR,PosSC[1]);
format(StrCAR, sizeof(StrCAR), "PosZ_%i", Slot);
DOF2_SetFloat(path,StrCAR,PosSC[2]);
format(StrCAR, sizeof(StrCAR), "PosA_%i", Slot);
DOF2_SetFloat(path,StrCAR,PosSC[3]);
format(StrCAR, sizeof(StrCAR), "Cor_%i", Slot);
DOF2_SetInt(path,StrCAR,SvCarCOR[Slot][playerid]);
DOF2_SaveFile();
    } else SvcShowDialgC(playerid);
return 1;
}
if(dialogid == SellCarPlyPly){
if(response){
new xPlayer,xValor,xSlot,RjhasfNome[32],StrScv[128];
if(sscanf(inputtext,"iii",xPlayer,xSlot,xValor)) return SendClientMessage(playerid , 0xFF0000FF , "Uso Correto /vendercarro [playerid][Slot][Valor]");
if(SVCarPLAYER[xSlot][playerid] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Você não está com o seu veiculo Spawnado!");
if(!IsPlayerConnected(xPlayer)) return SendClientMessage(playerid, 0xFFFFFFFF, "Este jogador não esta conectado!");
    new Float:PosP[3]; GetPlayerPos(xPlayer,PosP[0],PosP[1],PosP[2]);
    if(!IsPlayerInRangeOfPoint(playerid,5.0,PosP[0],PosP[1],PosP[2])) return SendClientMessage(playerid,0xFFFFFFFF,"Este jogador nao esta proximo a voce!");
new path[50],StrCAR[24];
path = SaveCarNomePlay(xPlayer);
format(StrCAR, sizeof(StrCAR), "CarID_%i", xSlot);
new SCCarid = DOF2_GetInt(path,StrCAR);
if(SCCarid < 400) return SendClientMessage(playerid, 0xFFFFFFFF, "Voce nao possui nenhum veiculo neste slot!");
pAceitar[xPlayer][0] = xValor;//Valor do Veiculo
pAceitar[xPlayer][1] = playerid;//ID do jogador que vendeu
pAceitar[xPlayer][2] = xSlot;//SLOT
        GetPlayerName(playerid, RjhasfNome, sizeof(RjhasfNome));
        format(StrScv, sizeof(StrScv), "[VEICULO]{FFFFFF} %s(%i) Quer te vender o veiculo (%s) por R$%i (/carmenu, opção [7])", RjhasfNome,playerid,SvCNomeCars[SCCarid-400],xValor);
        SendClientMessage(xPlayer, 0x666699FF, StrScv);
        GetPlayerName(xPlayer, RjhasfNome, sizeof(RjhasfNome));
        format(StrScv, sizeof(StrScv), "[VEICULO]{FFFFFF} Voce enviou uma solicitação de venda do veiculo (%s) para o %s(%i) por R$%i", SvCNomeCars[SCCarid-400],RjhasfNome,xPlayer,xValor);
        SendClientMessage(playerid, 0x666699FF, StrScv);
}else SvcShwDiagMenu(playerid);
return 1;
}
    if(dialogid == Dial_conseTX){
        if(response){
SvSelcCar[playerid] = listitem;
new ScStrG[500],rTing[128];
for(new i = 0; i < sizeof(SvC_InfCor); i++){
            format(rTing, sizeof(rTing), "%s\n", SvC_InfCor[i][1]);
                strcat(ScStrG, rTing);
}
ShowPlayerDialog(playerid, NIDConseCor, DIALOG_STYLE_LIST, "{666699}Seleciona a cor", ScStrG, "Proximo", "Voltar");
}else SvcShowDialgC(playerid);
return 1;
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

stock AlguemNoCarro(carroid){
for (new i = 0; i < MAX_PLAYERS; i++)
if (IsPlayerConnected(i))
    if(GetPlayerVehicleID(i) == carroid){
return 1;
}
return 0;
}


forward VisuCarFx(playerid);
public VisuCarFx(playerid){
if(ConseDoVis[playerid] != 0){
RemovePlayerFromVehicle(playerid);
if(ConseDoVis[playerid] == 1) SetPlayerPos(playerid,2134.5073,-1155.5154,24.2175);
else if(ConseDoVis[playerid] == 2) SetPlayerPos(playerid,2137.8337,-1155.5135,24.2175);
else if(ConseDoVis[playerid] == 3) SetPlayerPos(playerid,-1968.4557,294.0216,35.1719);
DestroyVehicle(VisuCAr[playerid]);
ConseDoVis[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
}
return 1;
}

stock SvcShowDialgC(playerid) return ShowPlayerDialog(playerid, Diag_CentralConse, DIALOG_STYLE_LIST, "{666699}Central Concessionária", "Comprar Veiculos\nVisualizar Veiculos", "Proximo", "Cancelar");

CMD:carmenu(playerid) return SvcShwDiagMenu(playerid);

CMD:editarconse(playerid)
{

new ScStrG[500];
    strcat(ScStrG, "{FFFFFF}Concessionária Popular\n");
strcat(ScStrG, "Concessionária de Motos \n");
strcat(ScStrG, "Concessionária de LUXO\n");
return ShowPlayerDialog(playerid, Diag_ConfigCs1, DIALOG_STYLE_LIST, "{666699}Configurar Concessionária", ScStrG, "proximo", "Cancelar");
}

stock SvcShwDiagMenu(playerid){
new ScStrG[500];
        strcat(ScStrG, "{FFFFFF}Estacionar\n");
strcat(ScStrG, "Localizar\n");
strcat(ScStrG, "Vender\n");
strcat(ScStrG, "Vender para um jogador\n");
strcat(ScStrG, "Aceitar a compra de um veiculo\n");
strcat(ScStrG, "Trancar\n");
strcat(ScStrG, "Destrancar\n");
if(SvC_BuySlotOnOff == true) strcat(ScStrG, "Upgrade Slots\n");
return ShowPlayerDialog(playerid, Diag_Menu_Car, DIALOG_STYLE_LIST, "{666699}Menu Carros", ScStrG, "Proximo", "Cancelar");
}

stock yChckVlrCar(modeid){
for (new i = 0; i < sizeof(TrValorVehNormal); i++)
    if(TrValorVehNormal[i][1] == modeid) return TrValorVehNormal[i][0]/2;
for (new i = 0; i < sizeof(TrValorVehMotos); i++)
    if(TrValorVehMotos[i][1] == modeid) return TrValorVehMotos[i][0]/2;
for (new i = 0; i < sizeof(TrValorVehLUXO); i++)
    if(TrValorVehLUXO[i][1] == modeid) return TrValorVehLUXO[i][0]/2;
return 20000;
}

CMD:conse(playerid){
    if(!IsPlayerInRangeOfPoint(playerid,2.0,2134.5073,-1155.5154,24.2175) && !IsPlayerInRangeOfPoint(playerid,2.0,2137.8337,-1155.5135,24.2175)
&& !IsPlayerInRangeOfPoint(playerid,2.0,-1968.4557,294.0216,35.1719)) return SendClientMessage(playerid, 0xFF0000FF, "Você não está em uma conse!");
    return SvcShowDialgC(playerid);
}



RE: Como fazer apenas admins usar um comando. - xbruno1000x - 22/09/2021

Código:
CMD:conse(playerid){
    if(!VARIAVEL DE LEVEL ADMIN AQUI) return SendClientMessage(playerid, -1, "Você não é admin!!");
Se o playerid não for admin, retorna a mensagem, caso seja, o comando será lido.

Você também pode coloca-lo somente para rcon admin com !IsPlayerAdmin


RE: Como fazer apenas admins usar um comando. - White_Blue - 25/03/2022

Você poderia usar a função IsPlayerAdmin se o comando for apenas para logados na rcon, mas caso contrario você tem que fazer um sistema de admin em dof2 ou dini senão não funcionará.


RE: Como fazer apenas admins usar um comando. - Klaba - 25/03/2022

Use flags, recomendo. Primeiro, defina as variáveis que os níveis de admin têm, exemplo:

Código:
enum _:E_ADMIN_LEVELS
{
  CMD_ADMIN
};
 Após, defina o comando:

Exemplo:
Código:
CMD:italo(playerid)
{
      SendClientMessage(playeid, -1, "Estou aprendendo a programar!");
      return 1;
}

Depois, defina a flag:

Código:
flags:italo(CMD_ADMIN);

lembrando, que deves ter o sscanf!


RE: Como fazer apenas admins usar um comando. - xbruno1000x - 25/03/2022

(25/03/2022 20:21)Klaba Escreveu: Depois, defina a flag:

Código:
flags:italo(CMD_ADMIN);

lembrando, que deves ter o sscanf!

Acho que o flags é do Pawn.CMD, não do sscanf.

Para quem desejar saber mais, existem informações no link abaixo:
https://portalsamp.com/thread-108.html


RE: Como fazer apenas admins usar um comando. - Klaba - 25/03/2022

(25/03/2022 21:19)xbruno1000x Escreveu:
(25/03/2022 20:21)Klaba Escreveu: Depois, defina a flag:

Código:
flags:italo(CMD_ADMIN);

lembrando, que deves ter o sscanf!

Acho que o flags é do Pawn.CMD, não do sscanf.

Para quem desejar saber mais, existem informações no link abaixo:
https://portalsamp.com/thread-108.html

KKKKK realmente, desculpe pelo erro!