You can easily make a command with Dialogs
For ZCMD
pawn Код:
CMD:paintjob(playerid, params[])
{
ShowPlayerDialog(playerid, 90, DIALOG_STYLE_LIST, "{FFFFFF}PaintJobs", "PaintJob 0\nPaintJob 1\nPaintJob 2\nPaintJob 3", "Select", "Cancel");
return 1;
}
OnDialogResponse
pawn Код:
if(dialogid == 90)
{
if(response) {
if(listitem == 0) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 0);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 1) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 1);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 2) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 2);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 3) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 3);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
}
}
If else, you are using strcmp
pawn Код:
if (strcmp(cmdtext, "/paintjob", true)==0)
{
ShowPlayerDialog(playerid, 90, DIALOG_STYLE_LIST, "{FFFFFF}PaintJobs", "PaintJob 0\nPaintJob 1\nPaintJob 2\nPaintJob 3", "Select", "Cancel");
return 1;
}
OnDialogResponse
pawn Код:
if(dialogid == 90)
{
if(response) {
if(listitem == 0) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 0);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 1) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 1);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 2) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 2);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
if(listitem == 3) {
if(IsPlayerInAnyVehicle(playerid)) {
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), 3);
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR] {FFFFFF}You are not in a vehicle!");
}
}
}