SA-MP Forums Archive
Please help. Vehicle Colours - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please help. Vehicle Colours (/showthread.php?tid=517154)



Please help. Vehicle Colours - 7emfic - 03.06.2014

Код:
if (strcmp("/clist", cmd, true) == 0)
{
new
    info[3343],
    count = -1;

for (new i; i != sizeof (gVehicleColors); ++i)
{
    format(info, sizeof (info), "%s{%06x}#%03i ", info, gVehicleColors[i] >>> 8, i);
    if (++count == 15)
    {
        strcat(info, "\n", sizeof (info));
        count = -1;
	}
	}
	ShowPlayerDialog(playerid, 9666, DIALOG_STYLE_MSGBOX, "Vehicle Colours", info, "Close", "");
return 1;
}
Why i have "SERVER: Unknown command." ? Please help.


Re: Please help. Vehicle Colours - rockhopper - 03.06.2014

Instead of dialogs use this
Код:
CMD:carcolour(playerid, params[])
{
    new c1,c2;
    new vid = GetPlayerVehicleID(playerid);
    if(pInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle to use this command.");
    if (vid == 0) return SendClientMessage(playerid, COLOR_RED, "/carcolour [0-255] [0-255]");
    if(!sscanf(params, "ii", c1,c2)){
    ChangeVehicleColor(vid, c1,c2);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "/carcolour [0-255] [0-255]");
    }
    return 1;
}



Re: Please help. Vehicle Colours - 7emfic - 03.06.2014

No no no.. i wanna it's




Re: Please help. Vehicle Colours - rockhopper - 03.06.2014

Show your on dialog response


Re: Please help. Vehicle Colours - rockhopper - 03.06.2014

Or Try This ...
Код:
CMD:clist(playerid, params[])
{
new
    info[3343],
    count = -1;

for (new i; i != sizeof (gVehicleColors); ++i)
{
    format(info, sizeof (info), "%s{%06x}#%03i ", info, gVehicleColors[i] >>> 8, i);
    if (++count == 15)
    {
        strcat(info, "\n", sizeof (info));
        count = -1;
	}
	}
	ShowPlayerDialog(playerid, 9666, DIALOG_STYLE_MSGBOX, "Vehicle Colours", info, "Close", "");
return 1;
}



Re: Please help. Vehicle Colours - 7emfic - 03.06.2014

Can you write how i must put this code in pawno? In public OnDialogResponse and command


Re: Please help. Vehicle Colours - 7emfic - 03.06.2014

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Or Try This ...
Код:
CMD:clist(playerid, params[])
{
new
    info[3343],
    count = -1;

for (new i; i != sizeof (gVehicleColors); ++i)
{
    format(info, sizeof (info), "%s{%06x}#%03i ", info, gVehicleColors[i] >>> 8, i);
    if (++count == 15)
    {
        strcat(info, "\n", sizeof (info));
        count = -1;
	}
	}
	ShowPlayerDialog(playerid, 9666, DIALOG_STYLE_MSGBOX, "Vehicle Colours", info, "Close", "");
return 1;
}
Thanks you. It working. Thx