PHP Code:
#include <a_samp>
#include <v_Control>
main(){}
public OnGameModeInit()
{
VehicleColor_Init(); // загружаем покраску
s_AddStaticVehicle(541, 2488.76, -1679.39, 12.96, 0.0, 3, 1, 0, 0); // без таймера респавна
s_AddStaticVehicleEx(541, 2492.76, -1679.39, 12.96, 0.0, 1, 0, 2, 0, 0); // с таймером
SetGameModeText("v_Control by SoNik))");
AddPlayerClass(40, 2490.8650,-1671.2910,13.3359,180.0,0,0,0,0,0,0);
return true;
}
public OnGameModeExit()
{
VehicleColor_Exit(); // выгружаем покраску
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/col1", true)) ShowChangleVehicleColor_1(playerid); // показываем меню покраски первого цвета
if(!strcmp(cmdtext, "/col2", true)) ShowChangleVehicleColor_2(playerid); // показываем меню покраски второго цвета
return true;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new str[35];
SendClientMessage(playerid,-1,"Введите /col1 или /col2 для покраски транспорта");
format(str,35,"{%06x} Цвет 1: %d",GetVehColToText_1(vehicleid),GetVehicleColor_1(vehicleid)); // форматируем цвет 1, %06x
SendClientMessage(playerid,-1,str); // Оправляем сообщение игроку
format(str,35,"{%06x} Цвет 2: %d",GetVehColToText_2(vehicleid),GetVehicleColor_2(vehicleid)); // форматируем цвет 2, %06x
SendClientMessage(playerid,-1,str); // Оправляем сообщение игроку
return true;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, 2490.8650,-1671.2910,13.3359);
SetPlayerFacingAngle(playerid, 180.0);
SetCameraBehindPlayer(playerid);
return true;
}