15.04.2016, 18:33
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new vehicleid = GetPlayerVehicleID(playerid); switch(newstate) { case PLAYER_STATE_DRIVER: { if(pInfo[playerid][Faction] > 1 || pInfo[playerid][Faction] < 1) return RemovePlayerFromVehicle(playerid); { if(vehicleid == LEOveh[0] || LEOveh[1] || LEOveh[2] || LEOveh[3] || LEOveh[4] || LEOveh[5] || LEOveh[6] || LEOveh[7] || LEOveh[8] || LEOveh[9] || LEOveh[10] || LEOveh[11]) SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You are not authorized to drive this vehicle!"); { SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Make sure your on police duty!"); } } if(vehicleid == EMSveh[0] || EMSveh[1] || EMSveh[2] || EMSveh[3] || EMSveh[4] || EMSveh[5] || EMSveh[6]) { if(pInfo[playerid][Faction] >= 3 || pInfo[playerid][Faction] < 2) return RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You are not authorized to drive this vehicle!"); { SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} Make sure your on EMS duty!"); } } TextDrawShowForPlayer(playerid, EngineInfo[playerid]); TextDrawShowForPlayer(playerid, SpeedoMeter[playerid]); TextDrawShowForPlayer(playerid, FuelMeter[playerid]); } case PLAYER_STATE_ONFOOT: { TextDrawHideForPlayer(playerid, EngineInfo[playerid]); TextDrawHideForPlayer(playerid, SpeedoMeter[playerid]); TextDrawHideForPlayer(playerid, FuelMeter[playerid]); } } return 1; }
Код:
LEOveh[0] = CreateVehicle(560, 22.9916,-194.5381,-5.8440,359.2776, 0, 0, 300); // Sultan LEOveh[1] = CreateVehicle(560, 27.2295,-194.5915,-5.8439,359.2776, 0, 0, 300); // Sultan LEOveh[2] = CreateVehicle(490, 44.8747,-194.8140,-5.8434,359.2776, 0, 1, 300); // Rancher LEOveh[3] = CreateVehicle(490, 40.4343,-194.7581,-5.8436,359.2776, 0, 1, 300); // Rancher LEOveh[4] = CreateVehicle(596, 35.9390,-194.7014,-5.8437,359.2776, 0, 1, 300); // LSPD car LEOveh[5] = CreateVehicle(596, 31.4414,-194.6447,-5.8438,359.2776, 0, 1, 300); // LSPD car // S.W.A.T Vehicles LEOveh[6] = CreateVehicle(528,53.1353,-194.9776,-16.6540,0.7449, 0, 1, 300); // S.W.A.T van LEOveh[7] = CreateVehicle(528,57.5905,-194.7393,-16.6518,0.9681, 0, 1, 300); // S.W.A.T van LEOveh[8] = CreateVehicle(427,44.3769,-194.4889,-16.5646,1.2594, 0, 1, 300); // S.W.A.T Truck LEOveh[9] = CreateVehicle(427,39.9407,-194.0349,-16.5640,359.3496, 0, 1, 300); // S.W.A.T Truck LEOveh[10] = CreateVehicle(601,62.0237,-193.7288,-16.9388,0.3296, 0, 1, 300); // S.W.A.T Tank LEOveh[11] = CreateVehicle(601,66.9175,-194.2490,-16.9387,0.9104, 0, 1, 300); // S.W.A.T Tank EMSveh[0] = CreateVehicle(544, 256.5102, 30.6222, 2.6286, 101.0000, 1, 3, 300); EMSveh[1] = CreateVehicle(544, 265.3205, 35.7823, 2.6286, 101.0000, 1, 3, 300); EMSveh[2] = CreateVehicle(407, 255.7389, 37.3692, 2.6172, 101.0000, 1, 3, 300); EMSveh[3] = CreateVehicle(407, 245.2494, 21.2684, 2.6172, 0.0000, 1, 3, 300); EMSveh[4] = CreateVehicle(407, 247.8347, 11.8377, 2.6172, 0.0000, 1, 3, 300); EMSveh[5] = CreateVehicle(490, 256.1381, -1.8474, 2.5215, 10.0000, 1, 3, 300); // rancher EMSveh[6] = CreateVehicle(490, 251.8316, 4.9825, 2.5215, 10.0000, 1, 3, 300); // rancher