16.12.2015, 18:20
Quote:
Erm wat?
Why wont u place the vehicles on the other ongamemodeinit? Show source pls. Btw why is mark rutte your profile picture dafuq? lold |
Anyway the full script:
PHP код:
#include <a_samp>
public OnGameModeInit()
{
// BaseObjects
CreateObject(3607, 1300.45557, 169.55232, 25.58073, 0.00000, 0.00000, 67.82463);
CreateObject(16151, 1310.16003, 134.05977, 19.82454, 0.00000, 0.00000, 333.26828);
CreateObject(1432, 1304.92847, 132.46878, 19.59503, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1306.75659, 137.79927, 19.49764, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1303.53137, 137.68436, 19.49949, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1305.59802, 135.19325, 19.58012, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1302.52734, 134.51579, 19.54607, 0.00000, 0.00000, 0.00000);
CreateObject(1775, 1314.34595, 140.64548, 20.30334, 0.00000, 0.00000, 245.46411);
CreateObject(9833, 1282.91980, 174.52245, 21.36313, 0.00000, 0.00000, 356.52475);
CreateObject(652, 1292.24011, 152.57188, 19.41948, 0.00000, 0.00000, 0.00000);
CreateObject(652, 1305.55396, 184.84261, 19.43826, 0.00000, 0.00000, 0.00000);
CreateObject(9833, 1296.68933, 144.35619, 21.36313, 0.00000, 0.00000, 356.52475);
CreateObject(9833, 1282.91980, 174.52245, 21.36313, 0.00000, 0.00000, 356.52475);
CreateObject(9833, 1314.00745, 190.94667, 21.36313, 0.00000, 0.00000, 356.52475);
CreateObject(1432, 1304.87524, 139.74910, 19.49949, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1301.96289, 131.85352, 19.54607, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1302.20081, 139.78084, 19.54607, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1301.09131, 136.79680, 19.54607, 0.00000, 0.00000, 0.00000);
CreateObject(1432, 1299.97571, 133.71315, 19.54607, 0.00000, 0.00000, 0.00000);
CreateObject(16375, 1324.74841, 157.27103, 31.12687, 0.00000, 0.00000, 0.00000);
return 1;
}
public OnPlayerConnect(playerid)
{
//Base
RemoveBuildingForPlayer(playerid, 3339, 1297.2813, 173.5781, 19.4609, 0.25);
RemoveBuildingForPlayer(playerid, 3340, 1308.3984, 168.1406, 19.4063, 0.25);
RemoveBuildingForPlayer(playerid, 3341, 1281.2266, 158.0938, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3343, 1295.9844, 158.7422, 19.3828, 0.25);
RemoveBuildingForPlayer(playerid, 3343, 1305.0391, 184.9141, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3345, 1298.6094, 194.2656, 19.3281, 0.25);
RemoveBuildingForPlayer(playerid, 3345, 1305.2656, 152.7734, 19.2969, 0.25);
RemoveBuildingForPlayer(playerid, 3344, 1299.7109, 138.7344, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3344, 1313.9688, 179.8438, 19.3594, 0.25);
RemoveBuildingForPlayer(playerid, 1294, 1244.1953, 84.0078, 25.2422, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1248.1875, 109.9531, 19.7266, 0.25);
RemoveBuildingForPlayer(playerid, 3594, 1265.5703, 153.3828, 19.4609, 0.25);
RemoveBuildingForPlayer(playerid, 769, 1267.9141, 146.8203, 19.1953, 0.25);
RemoveBuildingForPlayer(playerid, 3170, 1281.2266, 158.0938, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3594, 1280.9297, 147.3125, 20.0078, 0.25);
RemoveBuildingForPlayer(playerid, 3168, 1295.9844, 158.7422, 19.3828, 0.25);
RemoveBuildingForPlayer(playerid, 3171, 1299.7109, 138.7344, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3172, 1305.2656, 152.7734, 19.2969, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1301.2578, 147.3828, 18.8203, 0.25);
RemoveBuildingForPlayer(playerid, 780, 1301.5938, 154.5078, 19.3281, 0.25);
RemoveBuildingForPlayer(playerid, 3594, 1271.3125, 163.3906, 19.4375, 0.25);
RemoveBuildingForPlayer(playerid, 1294, 1264.5469, 172.2188, 23.0078, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1281.5156, 165.5313, 18.8203, 0.25);
RemoveBuildingForPlayer(playerid, 1440, 1297.0703, 179.2266, 19.9453, 0.25);
RemoveBuildingForPlayer(playerid, 1440, 1293.5547, 163.8828, 19.9453, 0.25);
RemoveBuildingForPlayer(playerid, 3168, 1305.0391, 184.9141, 19.3438, 0.25);
RemoveBuildingForPlayer(playerid, 3169, 1297.2813, 173.5781, 19.4609, 0.25);
RemoveBuildingForPlayer(playerid, 775, 1301.2734, 164.2656, 19.3516, 0.25);
RemoveBuildingForPlayer(playerid, 764, 1303.6328, 173.3984, 18.9375, 0.25);
RemoveBuildingForPlayer(playerid, 3171, 1313.9688, 179.8438, 19.3594, 0.25);
RemoveBuildingForPlayer(playerid, 3167, 1308.3984, 168.1406, 19.4063, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1308.2656, 174.2891, 18.8203, 0.25);
RemoveBuildingForPlayer(playerid, 1440, 1313.3203, 167.0313, 19.9453, 0.25);
RemoveBuildingForPlayer(playerid, 709, 1358.1484, 166.5234, 19.4609, 0.25);
RemoveBuildingForPlayer(playerid, 3172, 1298.6094, 194.2656, 19.3281, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 1274.1875, 191.4609, 18.8203, 0.25);
RemoveBuildingForPlayer(playerid, 1438, 1276.1172, 190.2266, 18.6094, 0.25);
RemoveBuildingForPlayer(playerid, 617, 1324.7266, 187.3516, 17.7813, 0.25);
RemoveBuildingForPlayer(playerid, 1440, 1318.3828, 196.0547, 19.6094, 0.25);
RemoveBuildingForPlayer(playerid, 705, 1290.4766, 198.6797, 18.7656, 0.25);
RemoveBuildingForPlayer(playerid, 13441, 1338.0625, 198.7344, 30.0234, 0.25);
return 1;
}
//PlayerSpawn
public OnPlayerSpawn(playerid) {
SetPlayerPos(playerid,1286.8938, 182.7496, 20.2734);
return 1;
}
// Vehicles command
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define l_red 0xFF0000AA
#define l_green 0x33FF33AA
new aVehicleNames[212][] =
{
{"Landstalker"},
{"Bravura"},
{"Buffalo"},
{"Linerunner"},
{"Perrenial"},
{"Sentinel"},
{"Dumper"},
{"Firetruck"},
{"Trashmaster"},
{"Stretch"},
{"Manana"},
{"Infernus"},
{"Voodoo"},
{"Pony"},
{"Mule"},
{"Cheetah"},
{"Ambulance"},
{"Leviathan"},
{"Moonbeam"},
{"Esperanto"},
{"Taxi"},
{"Washington"},
{"Bobcat"},
{"Mr Whoopee"},
{"BF Injection"},
{"Hunter"},
{"Premier"},
{"Enforcer"},
{"Securicar"},
{"Banshee"},
{"Predator"},
{"Bus"},
{"Rhino"},
{"Barracks"},
{"Hotknife"},
{"Trailer 1"},
{"Previon"},
{"Coach"},
{"Cabbie"},
{"Stallion"},
{"Rumpo"},
{"RC Bandit"},
{"Romero"},
{"Packer"},
{"Monster"},
{"Admiral"},
{"Squalo"},
{"Seasparrow"},
{"Pizzaboy"},
{"Tram"},
{"Trailer 2"},
{"Turismo"},
{"Speeder"},
{"Reefer"},
{"Tropic"},
{"Flatbed"},
{"Yankee"},
{"Caddy"},
{"Solair"},
{"Berkley's RC Van"},
{"Skimmer"},
{"PCJ-600"},
{"Faggio"},
{"Freeway"},
{"RC Baron"},
{"RC Raider"},
{"Glendale"},
{"Oceanic"},
{"Sanchez"},
{"Sparrow"},
{"Patriot"},
{"Quad"},
{"Coastguard"},
{"Dinghy"},
{"Hermes"},
{"Sabre"},
{"Rustler"},
{"ZR-350"},
{"Walton"},
{"Regina"},
{"Comet"},
{"BMX"},
{"Burrito"},
{"Camper"},
{"Marquis"},
{"Baggage"},
{"Dozer"},
{"Maverick"},
{"News Chopper"},
{"Rancher"},
{"FBI Rancher"},
{"Virgo"},
{"Greenwood"},
{"Jetmax"},
{"Hotring"},
{"Sandking"},
{"Blista Compact"},
{"Police Maverick"},
{"Boxville"},
{"Benson"},
{"Mesa"},
{"RC Goblin"},
{"Hotring Racer A"},
{"Hotring Racer B"},
{"Bloodring Banger"},
{"Rancher"},
{"Super GT"},
{"Elegant"},
{"Journey"},
{"Bike"},
{"Mountain Bike"},
{"Beagle"},
{"Cropdust"},
{"Stunt"},
{"Tanker"},
{"Roadtrain"},
{"Nebula"},
{"Majestic"},
{"Buccaneer"},
{"Shamal"},
{"Hydra"},
{"FCR-900"},
{"NRG-500"},
{"HPV1000"},
{"Cement Truck"},
{"Tow Truck"},
{"Fortune"},
{"Cadrona"},
{"FBI Truck"},
{"Willard"},
{"Forklift"},
{"Tractor"},
{"Combine"},
{"Feltzer"},
{"Remington"},
{"Slamvan"},
{"Blade"},
{"Freight"},
{"Streak"},
{"Vortex"},
{"Vincent"},
{"Bullet"},
{"Clover"},
{"Sadler"},
{"Firetruck LA"},
{"Hustler"},
{"Intruder"},
{"Primo"},
{"Cargobob"},
{"Tampa"},
{"Sunrise"},
{"Merit"},
{"Utility"},
{"Nevada"},
{"Yosemite"},
{"Windsor"},
{"Monster A"},
{"Monster B"},
{"Uranus"},
{"Jester"},
{"Sultan"},
{"Stratum"},
{"Elegy"},
{"Raindance"},
{"RC Tiger"},
{"Flash"},
{"Tahoma"},
{"Savanna"},
{"Bandito"},
{"Freight Flat"},
{"Streak Carriage"},
{"Kart"},
{"Mower"},
{"Duneride"},
{"Sweeper"},
{"Broadway"},
{"Tornado"},
{"AT-400"},
{"DFT-30"},
{"Huntley"},
{"Stafford"},
{"BF-400"},
{"Newsvan"},
{"Tug"},
{"Trailer 3"},
{"Emperor"},
{"Wayfarer"},
{"Euros"},
{"Hotdog"},
{"Club"},
{"Freight Carriage"},
{"Trailer 3"},
{"Andromada"},
{"Dodo"},
{"RC Cam"},
{"Launch"},
{"Police Car (LSPD)"},
{"Police Car (SFPD)"},
{"Police Car (LVPD)"},
{"Police Ranger"},
{"Picador"},
{"S.W.A.T. Van"},
{"Alpha"},
{"Phoenix"},
{"Glendale"},
{"Sadler"},
{"Luggage Trailer A"},
{"Luggage Trailer B"},
{"Stair Trailer"},
{"Boxville"},
{"Farm Plow"},
{"Utility Trailer"}
};
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[200], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/veh", true, 10) == 0) {
new String[200];
new tmp[256];
new Float:x, Float:y, Float:z;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You didn't give a vehicle name");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, l_green, String);
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
GetVehicleModelIDFromName(vname[])
{
for(new i = 0; i < 211; i++)
{
if(strfind(aVehicleNames[i], vname, true) != -1)
return i + 400;
}
return -1;
}
stock GetXYInFrontOfPlayer(playerid, &Float:x2, &Float:y2, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x2, y2, a);
GetPlayerFacingAngle(playerid, a);
if(GetPlayerVehicleID(playerid))
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x2 += (distance * floatsin(-a, degrees));
y2 += (distance * floatcos(-a, degrees));
}
//Vehicle
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
// Change the primary color to black and the secondary color to white
ChangeVehicleColor(vehicleid, 1, 1);
return 1;
}
//Base Vehicles
{
// Maverick
CreateVehicle(487,1254.5247,224.5698,26.7311,334.7154,1,1);
return 1;
}