Sistemul este creat de mine, nu este copiat, sau alte chesti..
Acest sistem poate fi foarte mult inbunatatit, eu postez o versiune simpla.
Include's necesare:
Pentru inceput adaugam in GM:
Acum cream callback-ul
Punem la OnDialogResponse()
Acum creem comanda
Nu postati acest tutorial fara acordul meu.
Tutorial realizat de Staark, toate drepturile rezervate !
(c) Staark - 2k15
Ultima editare efectuata de catre Vip3R. in Mier Mai 20, 2015 9:21 am, editata de 1 ori
Acest sistem poate fi foarte mult inbunatatit, eu postez o versiune simpla.
Include's necesare:
Cod:
ZCMD
Pentru inceput adaugam in GM:
Cod:
#define scm SendClientMessage
enum {
D_VEHS,
T_DIALOG1,
T_DIALOG2,
T_DIALOG3,
T_DIALOG4,
T_DIALOG5
}
new vehID;
Acum cream callback-ul
Punem la OnDialogResponse()
Cod:
// Tuning System !!!
if(dialogid == D_VEHS)
{
if(response)
{
switch(listitem)
{
case 0: // Spoiler
{
ShowPlayerDialog(playerid, T_DIALOG1, DIALOG_STYLE_LIST, "Tuning Service: Avaible Spoiler", "Pro\nWin\nDrag\nAlpha", "Update", "Cancel");
}
case 1: // Nitro
{
ShowPlayerDialog(playerid, T_DIALOG2, DIALOG_STYLE_LIST, "Tuning Service: Avaible Nitro", "Nitro - 5 times\nNitro - 2 times\nNitro - 10 times", "Update", "Cancel");
}
case 2: // Wheels
{
ShowPlayerDialog(playerid, T_DIALOG3, DIALOG_STYLE_LIST, "Tuning Service: Avaible Wheels", "Shadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nSwitch\nGrove\nImport\nDollar\nTrance\nAtomic", "Update", "Cancel");
}
case 3: // Lamps
{
ShowPlayerDialog(playerid, T_DIALOG4, DIALOG_STYLE_LIST, "Tuning Service: Avaible Lamps", "Round Fog\nSquare Fog", "Update", "Cancel");
}
case 4: // Repair Vehicle !
{
vehID = GetPlayerVehicleID(playerid);
RepairVehicle(vehID);
scm(playerid, -1, "Ti-ai reparat masina !");
}
}
}
return 1;
}
if(dialogid == T_DIALOG1) // Spoiler
{
if(response)
{
switch(listitem)
{
case 0:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1000);
scm(playerid, -1, "Ai instalat Spoiler !");
}
case 1:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1001);
scm(playerid, -1, "Ai instalat Spoiler !");
}
case 2:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1002);
scm(playerid, -1, "Ai instalat Spoiler !");
}
case 3:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1003);
scm(playerid, -1, "Ai instalat Spoiler !");
}
}
}
}
if(dialogid == T_DIALOG2) // Nitro
{
if(response)
{
switch(listitem)
{
case 0:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1008); // 5 times
scm(playerid, -1, "Ai instalat nitro !");
}
case 1:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1009); // 2 times
scm(playerid, -1, "Ai instalat nitro !");
}
case 2:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1010); // 10 times
scm(playerid, -1, "Ai instalat nitro !");
}
}
}
}
if(dialogid == T_DIALOG3) // Wheels
{
if(response)
{
switch(listitem)
{
case 0:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1073);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 1:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1074);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 2:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1075);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 3:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1076);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 4:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1077);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 5:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1078);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 6:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1079);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 7:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1080);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 8:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1081);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 9:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1082);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 10:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1083);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 11:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1084);
scm(playerid, -1, "Ai instalat Wheels !");
}
case 12:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1085);
scm(playerid, -1, "Ai instalat Wheels !");
}
}
}
}
if(dialogid == T_DIALOG4) // Lamps
{
if(response)
{
switch(listitem)
{
case 0:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1013); // Round Fog
scm(playerid, -1, "Ai instalat Lamps - Round Fog !");
}
case 1:
{
vehID = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehID, 1024); // Square Fog
scm(playerid, -1, "Ai instalat Lamps - Square Fog !");
}
}
}
}
Acum creem comanda
Cod:
CMD:tuning(playerid, params[]) // D_VEHS
{
vehID = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehID))
{
ShowPlayerDialog(playerid, D_VEHS, DIALOG_STYLE_LIST, "[Pay'n Spay] Tuning Service", "Spoiler\n Nitro\nWheels\nLamps\nRepair Car", "Select", "Cancel");
} else return scm(playerid, -1, "Nu esti intro masina !");
return 1;
}
Nu postati acest tutorial fara acordul meu.
Tutorial realizat de Staark, toate drepturile rezervate !
(c) Staark - 2k15
Ultima editare efectuata de catre Vip3R. in Mier Mai 20, 2015 9:21 am, editata de 1 ori