Herro[CM] |
Дата: Среда, 09.09.2015, 20:33 | Сообщение # 1
|
Бывалый
Сообщений: 425
Статус: Offline
|
Функции:
Код native sStartPickups() - запуск пикапа. native sStopPickups() - остановка пикапа. native sCreateVehiclePickup(vModel,Float:X,Float:Y,Float:Z,VirtualWorld) - создание автомобиля по пикапу. native sCreateNitroPickup(Float:X,Float:Y,Float:Z,VirtualWorld) - создает нитро пикап. native sCreateRepairPickup(Float:X,Float:Y,Float:Z,VirtualWorld) - создает пикап починки native sDestroyPickup(PickupID) - Убирает пикап. native sDestroyAllPickups() - Убирает все пикапы. native sCountPickups() - считает пикапы
Предупреждение: "sStartPickups (); требуется добавлять только в OnGameModeInit () или OnFilterScriptInit () "
Сам include
Код #if defined Credits
!---------------------------------------------------! !___________________________________________________! ! SSSS ! ! SSSSS SS SS SSSS SSSS SS SS SS SS ! ! SS SS SS SS SS SS SS SS SS SS SS SS ! ! SS SS SS SS SS SS SS SS SS SS SS ! ! SS SSSSSS SS SS SS SS SSSS SSSS ! ! SSSSSS SS SS SS SS SS SS SS SS SS ! ! SS SS SS SS SS SS SS SS SS SS ! ! SS SS SS SS SS SS SS SS SS SS SS ! ! SSSSS SS SS SSSS SSSS SSSSS SSSS ! !___________________________________________________! ! ! !---------------------------------------------------! #endif
#if defined _ShoPiks_included #endinput #endif #define _ShoPiks_included #pragma library ShoPiks
#include <a_samp>
#define MAX_sPICKUPS 100 #define sPICKUP_MODEL 19132
#define COLOR_RED 0xAA3333AA
new CarName[][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "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", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "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", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD Car", "SFPD Car", "LVPD Car", "Police Ranger", "Picador", "S.W.A.T Tank", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer 1", "Luggage Trailer 2", "Stairs Trailer", "Boxville", "Utility Trailer 1", "Utility Trailer 2" };
enum spInfo { sType, sCreated, Float:sX, Float:sY, Float:sZ, sPickup, Text3D:sText };
new sPickInfo[MAX_sPICKUPS][spInfo];
new newVeh[MAX_PLAYERS];
new tRepair[MAX_PLAYERS]; new tNitro[MAX_PLAYERS];
new sPkTimer;
stock sCreateRepairPickup(Float:X,Float:Y,Float:Z,VirtualWorld) { for(new i = 0; i < sizeof(sPickInfo); i++) { if(sPickInfo[i][sCreated] == 0) { sPickInfo[i][sCreated] = 1; sPickInfo[i][sType] = 201; sPickInfo[i][sX] = X; sPickInfo[i][sY] = Y; sPickInfo[i][sZ] = Z; sPickInfo[i][sPickup] = CreatePickup(sPICKUP_MODEL,23,X,Y,Z,VirtualWorld); sPickInfo[i][sText] = Create3DTextLabel("{FF0000}[{08E800}Repair{FF0000}]",COLOR_RED,X,Y,Z+0.7,300.0,VirtualWorld,0); return 1; } } return 0; }
stock sCreateNitroPickup(Float:X,Float:Y,Float:Z,VirtualWorld) { for(new i = 0; i < sizeof(sPickInfo); i++) { if(sPickInfo[i][sCreated] == 0) { sPickInfo[i][sCreated] = 1; sPickInfo[i][sType] = 202; sPickInfo[i][sX] = X; sPickInfo[i][sY] = Y; sPickInfo[i][sZ] = Z; sPickInfo[i][sPickup] = CreatePickup(sPICKUP_MODEL,23,X,Y,Z,VirtualWorld); sPickInfo[i][sText] = Create3DTextLabel("{FF0000}[{08E800}Nitro{FF0000}]",COLOR_RED,X,Y,Z+0.7,300.0,VirtualWorld,0); return 1; } } return 0; }
stock sCreateVehiclePickup(vModel,Float:X,Float:Y,Float:Z,VirtualWorld) { for(new i = 0; i < sizeof(sPickInfo); i++) { if(sPickInfo[i][sCreated] == 0) { new vehName[128]; format(vehName,sizeof(vehName),"{FF0000}[{0076FC}%s{FF0000}]",CarName[vModel - 400]); sPickInfo[i][sCreated] = 1; sPickInfo[i][sType] = vModel; sPickInfo[i][sX] = X; sPickInfo[i][sY] = Y; sPickInfo[i][sZ] = Z; sPickInfo[i][sPickup] = CreatePickup(sPICKUP_MODEL,23,X,Y,Z,VirtualWorld); sPickInfo[i][sText] = Create3DTextLabel(vehName,COLOR_RED,X,Y,Z+0.7,300.0,VirtualWorld,0); return 1; } } return 0; }
stock sDestroyPickup(PickupID) { sPickInfo[PickupID][sCreated] = 0; DestroyPickup(sPickInfo[PickupID][sPickup]); Destroy3DTextLabel(sPickInfo[PickupID][sText]); }
stock sStartPickups() { sPkTimer = SetTimer("vChange",100,1); }
stock sStopPickups() { KillTimer(sPkTimer); }
stock sCountPickups() { new sPkCount = 0; for(new i = 0; i < MAX_sPICKUPS; i++) { if(sPickInfo[i][sCreated] == 1) { sPkCount++; } } return sPkCount; }
stock sDestroyAllPickups() { for(new i = 0; i < MAX_sPICKUPS; i++) { if(sPickInfo[i][sCreated] == 1) { sPickInfo[PickupID][sCreated] = 0; DestroyPickup(sPickInfo[PickupID][sPickup]); Destroy3DTextLabel(sPickInfo[PickupID][sText]); } } }
forward vChange(); public vChange() { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { for(new z = 0; z < sizeof(sPickInfo); z++) { if(sPickInfo[z][sType] > 300) { if(IsPlayerInRangeOfPoint(i, 3.5, sPickInfo[z][sX], sPickInfo[z][sY], sPickInfo[z][sZ])) { if(sPickInfo[z][sCreated] == 1) { if(IsPlayerInAnyVehicle(i)) { if(GetVehicleModel(GetPlayerVehicleID(i)) != sPickInfo[z][sType]) { new Float:vpX,Float:vpY,Float:vpZ,Float:vR,Float:vvX,Float:vvY,Float:vvZ,Float:vH; GetVehicleHealth(GetPlayerVehicleID(i),vH); GetVehiclePos(GetPlayerVehicleID(i),vpX,vpY,vpZ); GetVehicleVelocity(GetPlayerVehicleID(i),vvX,vvY,vvZ); GetVehicleZAngle(GetPlayerVehicleID(i),vR); DestroyVehicle(GetPlayerVehicleID(i)); newVeh[i] = CreateVehicle(sPickInfo[z][sType],vpX,vpY,vpZ,vR,random(126),random(126),1000); PutPlayerInVehicle(i,newVeh[i],0); SetVehicleVelocity(newVeh[i],vvX,vvY,vvZ); SetVehicleHealth(newVeh[i],vH); } } return 1; } } } else if(sPickInfo[z][sType] < 300) { if(sPickInfo[z][sType] == 201) { if(IsPlayerInRangeOfPoint(i, 3.5, sPickInfo[z][sX], sPickInfo[z][sY], sPickInfo[z][sZ])) { if(sPickInfo[z][sCreated] == 1) { if(IsPlayerInAnyVehicle(i)) { if(GetTickCount() - tRepair[i] > 3000) { tRepair[i] = GetTickCount(); SetVehicleHealth(GetPlayerVehicleID(i),1000.0); } } } } } if(sPickInfo[z][sType] == 202) { if(IsPlayerInRangeOfPoint(i, 3.5, sPickInfo[z][sX], sPickInfo[z][sY], sPickInfo[z][sZ])) { if(sPickInfo[z][sCreated] == 1) { if(IsPlayerInAnyVehicle(i)) { if(GetTickCount() - tNitro[i] > 3000) { tNitro[i] = GetTickCount(); AddVehicleComponent(GetPlayerVehicleID(i),1010); } } } } } } } return 1; } } return 1; }
/* native sStartPickups() native sStopPickups() native sCreateVehiclePickup(vModel,Float:X,Float:Y,Float:Z,VirtualWorld) native sCreateNitroPickup(Float:X,Float:Y,Float:Z,VirtualWorld) native sCreateRepairPickup(Float:X,Float:Y,Float:Z,VirtualWorld) native sDestroyPickup(PickupID) native sDestroyAllPickups() native sCountPickups() */
Автор: ShOoBy
Когда нет знания, есть мнение.
|
|
|
|