#define FILTERSCRIPT#include a_samp#include streamer//Csomag pozíciók:new Float:csomagok[3][4] = { {1595.0059,-1229.1215,278.0}, // teszt 1 {1595.2092,-1235.9232,278.0}, // teszt 2 {1595.1885,-1250.3318,278.0} // teszt 3};new pick;public OnFilterScriptInit() { SetTimer(\"RandomCsomag\", 60000*15, true); return 1;}public OnPlayerPickUpDynamicPickup(playerid, pickupid) { if(pickupid == pick) { DestroyDynamicPickup(pick); GivePlayerMoney(playerid, 5000); new str[512]; format(str, sizeof(str), \"%s megtalálta a rejtett csomagot! Jutalma: $5000!\"); SendClientMessageToAll(-1, str); } return 1;}forward RandomCsomag();public RandomCsomag() { new rand = random(sizeof(csomagok)); pick = CreateDynamicPickup(1279, 1, csomagok[rand][0], csomagok[rand][1], csomagok[rand][2], -1); new str[512]; format(str, sizeof(str), \"Csomag el lett helyezve! Itt: %s\", GetCsomagHelyNeve(rand)); SendClientMessageToAll(-1, str); return 1;}stock GetCsomagHelyNeve(id) { new nev[32]; switch(id) { case 0: nev = \"teszt 1\"; case 1: nev = \"teszt 2\"; case 2: nev = \"teszt 3\"; } return nev;}
Ezt próbáltad már?http://forum.sa-mp.com/showthread.php?t=394288bumpwarning
A munkát Flash készítette. #define FILTERSCRIPT#include a_samp#include streamer//Csomag pozíciók:new Float:csomagok[3][4] = { {1595.0059,-1229.1215,278.0}, // teszt 1 {1595.2092,-1235.9232,278.0}, // teszt 2 {1595.1885,-1250.3318,278.0} // teszt 3};new pick;public OnFilterScriptInit() { SetTimer(\"RandomCsomag\", 60000*15, true); return 1;}public OnPlayerPickUpDynamicPickup(playerid, pickupid) { if(pickupid == pick) { DestroyDynamicPickup(pick); GivePlayerMoney(playerid, 5000); new str[512]; format(str, sizeof(str), \"%s megtalálta a rejtett csomagot! Jutalma: $5000!\"); SendClientMessageToAll(-1, str); } return 1;}forward RandomCsomag();public RandomCsomag() { new rand = random(sizeof(csomagok)); pick = CreateDynamicPickup(1279, 1, csomagok[rand][0], csomagok[rand][1], csomagok[rand][2], -1); new str[512]; format(str, sizeof(str), \"Csomag el lett helyezve! Itt: %s\", GetCsomagHelyNeve(rand)); SendClientMessageToAll(-1, str); return 1;}stock GetCsomagHelyNeve(id) { new nev[32]; switch(id) { case 0: nev = \"teszt 1\"; case 1: nev = \"teszt 2\"; case 2: nev = \"teszt 3\"; } return nev;} [/quote]Én ezt nem így gondoltam Hanem, hogy előre leteszek rejtett csomagokat amiket fel lehet venni. Leteszek mondjuk 100 vagy 200 rejtett csomagok amit meg kell találni. Nem pedig 1 random helyeken spawnol :)Csak amiket próbáltam ez velük a probléma, hogy akárhányszor fel lehet venni
/* |__________ INCLUDES __________| */#include <a_samp>#include <dini>#include <letter>#pragma unused strtok/* |__________ DEFINES __________| */#define MAX_HIDDEN_PACKAGES 100 // NUMBER OF HIDDEN PACKAGES.#define MAX_TEXT 256#define COLOR_YELLOW 0xFFFF00AA/* |__________ VARIABLES __________| */new Hidden_Package[MAX_HIDDEN_PACKAGES]; // EACH HIDDEN PACKAGE FROM ID 0 TO ID MAX_HIDDEN_PACKAGES.new Current_Hidden_Packages[MAX_PLAYERS]; // NUMBER OF FOUND HIDDEN PACKAGES.new Float:Hidden_Package_IDs[MAX_HIDDEN_PACKAGES][3] = // COORDINATES OF ALL HIDDEN PACKAGES.{{2768.4902, -2568.7849, 3.0000}, // ID 0{2197.9441, -2619.7041, 13.5469}, // ID 1{1470.3052, -2311.9072, 13.5469}, // ...{1651.0134, -2266.8091, -1.2530},{1383.4541, -2586.1792, 13.5469},{1627.4774, -2286.4812, 94.1270},{1093.2889, -2025.9854, 69.0006},{1363.4103, -1793.9836, 36.0156},{1690.8455, -1966.2902, 8.4602},{2666.0671, -1438.6959, 16.2500},{2482.6536, -1642.6366, 23.3723},{2320.5989, -1631.7844, 14.7173},{2070.5117, -1549.4768, 13.4302},{1720.7542, -1472.9568, 13.5513},{1915.3109, -1354.9108, 23.3599},{1530.9926, -1370.1509, 330.0517},{1511.6372, -1363.0046, 13.8947},{1248.3285, -1249.9541, 63.6841},{1073.7805, -1303.6627, 17.0543},{745.4824, -1381.3788, 25.6922},{836.3892, -1855.6019, 8.3865},{498.4997, -1870.7065, 4.6770},{401.9062, -1624.8300, 34.1719},{782.8715, -1019.8885, 26.3594},{1292.0284, -907.3792, 42.8753},{2013.8229, -962.6664, 42.4609},{2426.5466, -1015.3012, 54.3438},{2866.2214, -1588.5083, 22.4044},{2820.2317, -1467.3678, 36.0938},{2680.0959, -1807.2950, 31.4370},{153.7645, -1953.9977, 47.8750},{2233.3699, -2283.0850, 14.3751},{-91.0992, -1577.9250, 2.6172},{-362.9275, -1417.3674, 29.6406},{-1104.3428, -1639.4332, 76.3672},{-1848.4636, -1708.7059, 41.1107},{-2155.8093, -2352.2378, 30.6983},{-1619.5502, -2690.4038, 48.7427},{-2229.4404, -1741.3108, 480.8764},{-2672.1365, -980.7251, 1.2747},{-2762.7461, -262.4333, 7.1875},{-2797.5637, -124.1847, 7.1875},{-2707.9915, 378.0378, 11.9795},{-2912.9280, 1241.6732, 1.4253},{-2173.6597, 1213.2341, 37.3203},{-2317.3750, 1066.8712, 66.6719},{-1970.1837, 705.9767, 47.9662},{-2278.5820, 629.7546, 53.0781},{-2494.7817, 314.4330, 29.2169},{-2060.0503, 254.6434, 37.1042},{-1973.1315, 114.8011, 30.5982},{-2018.0607, -104.7838, 35.0410},{-2222.4832, -301.9987, 42.8300},{-2531.7791, -704.7221, 139.3203},{-1539.8923, -438.0551, 6.0000},{-1611.0992, -697.0815, 1.9609},{875.2626, -589.4353, 17.9672},{194.1474, -234.6030, 1.7786},{1236.8372, 374.3524, 19.5547},{2102.5872, -105.6869, 2.1675},{-2446.7590, 758.0258, 41.2544},{-2250.0825, 2418.1816, 2.4971},{-1417.2766, 2578.9851, 55.8433},{-910.2416, 2672.3164, 42.3703},{-242.2349, 2712.3855, 66.7729},{-943.9116, 1432.1997, 30.0597},{-101.9302, 1228.0914, 22.4403},{246.8122, 1435.1863, 23.3703},{164.1322, 1849.8777, 33.8984},{232.0335, 1858.2056, 15.7570},{1628.2853, 600.5630, 1.7578},{1752.9011, 980.4847, 12.8846},{1715.3793, 1313.3262, 10.8203},{1690.0076, 1483.9884, 11.6853},{1308.0775, 1261.3682, 14.2656},{1580.7028, 1488.8589, 17.1726},{1617.8373, 1440.0409, 25.7109},{1875.2921, 2076.3557, 16.0869},{1939.4369, 2375.5225, 23.8516},{2044.4320, 2377.0112, 143.6016},{1488.7166, 2773.9272, 10.8203},{1432.6461, 2751.2517, 19.5234},{1265.5323, 2609.3586, 10.8203},{755.6589, 2060.2891, 6.7109},{797.1666, 1669.3445, 5.2813},{710.4031, 1207.6122, 13.8481},{2365.5840, 1006.3339, 10.8203},{2339.7266, 1305.0051, 67.4688},{2454.4670, 1499.4634, 11.6003},{2406.2490, 1681.4222, 14.2734},{2094.7532, 1890.3156, 10.3510},{1980.7120, 2166.0576, 11.0776},{1976.3352, 2266.9121, 27.1953},{1972.5507, 2294.6968, 16.4559},{2288.3350, 2442.8613, 10.8203},{2225.0254, 2529.6418, 17.4058},{2809.6814, 2972.3298, 1.2368},{-1113.1520, 845.4919, 3.0778}, // ...{-1504.8862, 1374.2853, 3.8896}, // ID 98{-2415.2017, 1554.2524, 26.0469} // ID 99};/* |__________ CALLBACKS __________| */public OnFilterScriptInit(){return 1;}public OnPlayerConnect(playerid){if(dini_Exists(PlayerFile(playerid))){for(new ID = 0; ID < MAX_HIDDEN_PACKAGES; ID++){ Hidden_Package[iD] = dini_Int(PlayerFile(playerid), HiddenPackageText(ID));}}else{dini_Create(PlayerFile(playerid));dini_IntSet(PlayerFile(playerid), \"Current Hidden Packages\", 0);for(new ID = 0; ID < MAX_HIDDEN_PACKAGES; ID++){ dini_IntSet(PlayerFile(playerid), HiddenPackageText(ID), 0); Hidden_Package[iD] = dini_Int(PlayerFile(playerid), HiddenPackageText(ID));}}Current_Hidden_Packages[playerid] = dini_Int(PlayerFile(playerid), \"Current Hidden Packages\");return 1;}public OnPlayerRequestSpawn(playerid){for(new ID = 0; ID < MAX_HIDDEN_PACKAGES; ID++){if(dini_Int(PlayerFile(playerid), HiddenPackageText(ID)) == 0){ Hidden_Package[iD] = CreatePlayerObject(playerid, 1279, Hidden_Package_IDs[iD][0], Hidden_Package_IDs[iD][1], Hidden_Package_IDs[iD][2], 0, 0, 0, 0.0);}}return 1;}public OnPlayerUpdate(playerid){IsPlayerAtHiddenPackage(playerid); // CALLS THE FUNCTION FREQUENTLY.return 1;}/* |__________ FUNCTIONS __________| */stock HiddenPackageText(ID) // GETS THE HIDDEN PACKAGE.{new text[MAX_TEXT];format(text, sizeof(text), \"Hidden Package %d\", ID);return text;}stock PlayerFile(playerid) // GETS THE PLAYER FILE.{new file[MAX_TEXT];format(file, sizeof(file), \"HiddenPackages/%s.ini\", PlayerName(playerid));return file;}stock PlayerName(playerid) // GETS THE PLAYER NAME.{new name[MAX_PLAYER_NAME];GetPlayerName(playerid, name, sizeof(name));return name;}stock IsPlayerAtHiddenPackage(playerid) // CHECKS IF THE PLAYER FOUND A HIDDEN PACKAGE.{new text[MAX_TEXT];for(new ID = 0; ID < MAX_HIDDEN_PACKAGES; ID++){if(dini_Int(PlayerFile(playerid), HiddenPackageText(ID)) == 0){ if(IsPlayerInRangeOfPoint(playerid, 1, Hidden_Package_IDs[iD][0], Hidden_Package_IDs[iD][1], Hidden_Package_IDs[iD][2])) { DestroyPlayerObject(playerid, Hidden_Package[iD]); // DESTROYS THE HIDDEN PACKAGE. dini_IntSet(PlayerFile(playerid), HiddenPackageText(ID), 1); Current_Hidden_Packages[playerid]++; // ADDS +1 HIDDEN PACKAGE AS FOUND. dini_IntSet(PlayerFile(playerid), \"Current Hidden Packages\", Current_Hidden_Packages[playerid]); PlayerPlaySound(playerid, 1150, Hidden_Package_IDs[iD][0], Hidden_Package_IDs[iD][1], Hidden_Package_IDs[iD][2]); // PLAYS A SOUND WHEN A HIDDEN PACKAGE HAS BEEN FOUND. if(Current_Hidden_Packages[playerid] < MAX_HIDDEN_PACKAGES) { format(text, sizeof(text), \"~r~~h~~h~~h~~h~~h~Rejtettcsomag %d of %d\", Current_Hidden_Packages[playerid], MAX_HIDDEN_PACKAGES); // GAMETEXT FOR CURRENT AMOUNT OF FOUND HIDDEN PACKAGES. GameTextForPlayer(playerid, text, 5000, 4); } else { GivePlayerMoney(playerid, 100100); // REWARD FOR FINDING ALL HIDDEN PACKAGES. GameTextForPlayer(playerid, \"~b~Gratulálunk! Az összes rejtett csomagot megtaláltad!\", 5000, 4); // GAMETEXT WHEN FINDING ALL HIDDEN PACKAGES. SendClientMessage(playerid, COLOR_YELLOW, \"Egy kis jutalom az összes rejtett csomagért: 500.000 Ft\"); // REWARD FOR FINDING ALL HIDDEN PACKAGES. } }}}return 1;}