pawn Код:
#include <a_samp>
enum mbinfo
{
Float:XPOS,
Float:YPOS,
Float:ZPOS,
Position[50]
};
new Float:MBSPAWN[][mbinfo] =
{
// Positions, (X, Y, Z, Location)
{-2215.1213, -122.7337, 35.3203, "Garcia"},
{-2135.3081, 164.3236, 35.3188, "Doherty"},
{-2185.4272, 451.1968, 35.1642,"King's"},
{-2447.4580, 523.3387, 30.3721, "Queens"},
{-2668.3193, 787.8219, 49.9766, "Santa Flora"},
{-2668.3193, 787.8219, 49.9766, "Santa Flora"},
{-2721.0737, 857.3708, 70.7031, "Paradiso"},
{-2642.4172, 951.4840, 71.9531, "Paradiso"},
{-2441.1458, 935.1525, 45.4226, "Juniper Hill"},
{-2314.6501, 1068.2839, 65.5859, "Juniper Hollow"},
{-2211.8169, 1057.0775, 80.0131, "Galton Heights"},
{-2030.8300, 1117.9238, 65.3215, "Galton Heights"},
{-1944.9574, 954.9470, 54.4121, "Downtown"},
{-1921.5079, 992.8000, 45.4297, "Downtown"},
{-1835.1073, 1054.3900, 46.0781, "Financial"},
{-1854.4506, 1305.1901, 22.5674, "Esplanade North"},
{-1753.7559, 885.7334, 295.8750, "Financial"},
{-1747.7025, 187.2599, 3.5496, "Easter Basin"},
{-1702.2744, 17.1471, 3.5547, "Easter Basin"},
{-1666.7700, 75.1593, -11.2344, "Easter Basin"},
{-1342.3568, 439.1101, 7.1875, "Army Base"},
{-1274.2994, 57.9993, 71.1055, "Easter Bay Airport"},
{-1395.7847, -246.4495, 6.0000, "Easter Bay Airport"},
{-1736.6927, -441.3435, 1.9609, "Easter Bay Airport"},
{-1954.5280, -754.2645, 41.8281, "Foster Valley"},
{-2156.5642, -455.6840, 49.8521, "Foster Valley"},
{-2399.0178, -256.1098, 39.7953, "Avispa Country Club"},
{-2660.7302, -300.5406, 7.2071, "Avispa Country Club"},
{-2788.8499, -232.8983, 7.1875, "Avispa Country Club"},
{-2766.1487, -2.4879, 7.1875, "Ocean Flats"},
{-2735.8401, 133.1577, 4.2663, "Ocean Flats"},
{-2775.0520, 775.1570, 59.4297, "Palisades"},
{-2656.8181, 1594.8845, 64.4462, "Gant Bridge"},
{-2414.5806, 1538.8478, 26.0469, "Gant Bridge"},
{-1599.6156, 1335.2417, 3.3564, "Esplanade North"},
{-1253.4795, 952.5622, 45.1418, "Garver Bridge"},
{-1047.2872, 925.4066, 32.3085, "Kincaid Bridge"},
{-1806.4141, 555.5465, 35.1641, "Downtown"},
{-2350.6084, 653.9871, 52.0469, "Juniper Hill"},
{-2303.8025, 929.2978, 59.5703, "Juniper Hill"},
{-2587.0510, 827.3026, 50.0515, "Paradiso"}
};
new Float:MoneyBagPos[3], MoneyBagFound=1, MoneyBagLocation[50], MoneyBagPickup, Timer[2];
//Hours, Minutes, Seconds, Milliseconds
#define MoneyBagDelay(%1,%2,%3,%4) (%1*3600000)+(%2*60000)+(%3*1000)+%4
//20 = 200,000 minimum 30 = 200,000 -> 500,000
#define MoneyBagCash ((random(30)+20)*10000)
//10 mins!
#define MB_DELAY MoneyBagDelay(0, 10, 0, 0)
public OnFilterScriptInit()
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
return 1;
}
forward MoneyBag();
public MoneyBag()
{
new string[175];
if(!MoneyBagFound)
{
format(string, sizeof(string), "{AFAFAF}The Briefcase has not been found, it is still hidden in %s", MoneyBagLocation);
SendClientMessageToAll(-1, string);
}
else if(MoneyBagFound)
{
MoneyBagFound = 0;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(string, sizeof(string), "{AFAFAF}Hint: Current Briefcase has been Founded in %s!", MoneyBagLocation);
SendClientMessageToAll(-1, string);
MoneyBagPickup = CreatePickup(1210, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid))
{
if(!strcmp("/gotomb", cmdtext, true))
{
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been teleported to the Briefcase");
}
if(!strcmp("/startmb", cmdtext, true)) return MoneyBag();
if(!strcmp("/togglemb", cmdtext, true))
{
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Briefcase turned off!");
return 1;
}
if(Timer[0] == 1)
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Briefcase turned on!");
return 1;
}
return 1;
}
}
if(!strcmp("/moneybag", cmdtext, true))
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "{AFAFAF}Hint: Current Briefcase has been Found in %s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "{AFAFAF}The Briefcase is not running!");
return SendClientMessage(playerid, -1, string);
}
return 0;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == MoneyBagPickup)
{
new string[180], pname[24], money = MoneyBagCash;
GetPlayerName(playerid, pname, 24);
MoneyBagFound = 1;
DestroyPickup(MoneyBagPickup);
SendClientMessage(playerid, -1, "You have found the Briefcase!");
GivePlayerMoney(playerid, money);
GivePlayerWeapon(playerid,32,5000000);
GivePlayerWeapon(playerid,31,5000000);
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
format(string, sizeof(string), "{33CCFF}%s has found the Briefcase in %s", pname, MoneyBagLocation);
SendClientMessageToAll(-1, string);
format(string, sizeof(string), "{33CCFF}%s has Open the Briefcase and found: ", pname, money, MoneyBagLocation);
SendClientMessageToAll(-1, string);
format(string, sizeof(string), "{33CCFF}Armour + tec9 + health", money);
SendClientMessageToAll(-1, string);
format(string, sizeof(string), "{33CCFF}Cash = %d", money);
SendClientMessageToAll(-1, string);
}
return 1;
}
SO everytime the server restarts The admin Will have to login and Again Type /startmb
its spawns at random locations which are added and very hard locations i try this at me its working perfect and the MB starts without using of /startmb