#include #include #define RED 0xE60000FF #define ORANGE 0xF97804FF #define WHITE 0xFFFFFFFF #define PURPLE 0xB360FDFF new WeaponBox; new Text3D:BoxLabel; new isSpawned[MAX_PLAYERS]; new bool: BoxSpawned,bool:AdminBox; stock playername(playerid) { new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName,MAX_PLAYER_NAME); return pName; } public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Goldpot Script."); print("--------------------------------------\n"); WeaponBox = CreateObject(3796,300,300,3000,0.00000000,0.00000000,0.00000000,100); SetTimer("BoxSpawnCheck" , 500 ,1); SetTimer("BoxAutoSpawn", 300 * 500 ,1); BoxSpawned = false; AdminBox = false; SetTimer("RandomBoxSpawn", 300 * 1000, true); SendClientMessageToAll(ORANGE,"Goldpot Script"); return 1; } /* forward BoxAutoSpawn(); public BoxAutoSpawn() { if (BoxSpawned == true) { DestroyObject(WeaponBox); Delete3DTextLabel(BoxLabel); spawnbox(); } printf("stuff","stuff"); } */ forward spawnbox(); public OnFilterScriptExit() { print("\n--------------------------------------"); print(" Goldpot script."); print("--------------------------------------\n"); DestroyObject(WeaponBox); Delete3DTextLabel(BoxLabel); BoxSpawned = false; AdminBox = false; SendClientMessageToAll(RED,"Goldpot script."); return 1; } command(box,playerid,params[]) // used to debug things mainly. { new Float:X, Float:Y, Float:Z; if (IsPlayerAdmin(playerid)) { DestroyObject(WeaponBox); Delete3DTextLabel(BoxLabel); GetPlayerPos(playerid,X,Y,Z); WeaponBox = CreateObject(1550,X,Y,Z-1,0.00000000,0.00000000,0.00000000,100); BoxLabel = Create3DTextLabel("Goldpot script",ORANGE,X,Y,Z+1,100,0,true); BoxSpawned = true; AdminBox = true; SendClientMessageToAll(PURPLE,"A Goldpot script has been spotted in San Andreas!"); // I did plan to do more here, will do some more shit in the next update. return 1; } { SendClientMessage(playerid,RED, "You aren't an admin"); return 1; } } Float:GetDistance( Float: x1, Float: y1, Float: z1, Float: x2, Float: y2, Float: z2 ) //credits to whom ever this came from, I have forgotten. { new Float:d; d += floatpower(x1-x2, 2.0 ); d += floatpower(y1-y2, 2.0 ); d += floatpower(z1-z2, 2.0 ); d = floatsqroot(d); return d; } public spawnbox() { switch (random(8)) { case 0:{ WeaponBox = CreateObject(1550,154.3803, -1946.2564, 5.1632,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {9933FF}Find the GOldpot Worth 10000$ And 10 Scores(hint:Lighthouse)"); } case 1:{ WeaponBox = CreateObject(1550,2100.9372, -1649.0474, 13.4390,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {9933FF}Find the GOldpot Worth 10000$ And 10 Scores(hint:CJ First Tagging Mission)"); } case 2:{ WeaponBox = CreateObject(1550,2539.5004, 2161.4807, 10.8203,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]:{FF6600}Find the Goldpot Worth 10000$ And 10 Scores(hint:LV Gift And Jewellers)"); //SendClientMessageToAll(ORANGE,"{FF6600}Go get it before anyone else does!"); } case 3:{ WeaponBox = CreateObject(1550,-1633.2149, 1421.2930, 7.1875,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {FF00CC}Find the Goldpot Worth 10000$ And 10 Scores(hint:Pier 69)"); } case 4:{ WeaponBox = CreateObject(1550,2002.0093, 1544.3480, 13.5859,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {FFFF00}Find the Goldpot Worth 10000$ And 10 Scores(hint:PirateShip)"); } case 5:{ WeaponBox = CreateObject(1550,2323.7473, 1283.1275, 97.5359,100,0,0); BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {FF9900}Find the Goldpot Worth 10000$ And 10 Scores(hint:On The Top of The Pyramid)"); } case 6:{ WeaponBox = CreateObject(1550,2089.1010, 1450.8000, 10.8203,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {FF9900}Find the Goldpot Worth 10000$ And 10 Scores(hint:Royal Casino)"); } case 7:{ WeaponBox = CreateObject(1550,-1249.8885, 501.5375, 18.2343,100,0,0); //BoxLabel = Create3DTextLabel("Goldpot",ORANGE,0,0,0,100,0,true); SendClientMessageToAll(WHITE,"[GOLDPOT]: {00FF00}Find the Goldpot Worth 10000$ And 10 Scores(hint:I Bet My Hydra Can Land Of That Ship)!"); } } return 1; } command(forcespawn,playerid,params) { if (IsPlayerAdmin(playerid)) { BoxSpawned = true; AdminBox = true; spawnbox(); return 1; } SendClientMessage(playerid,RED,"You aren't an admin!"); return 1; } forward RandomBoxSpawn(); public RandomBoxSpawn() {if (BoxSpawned == true) { DestroyObject(WeaponBox); Delete3DTextLabel(BoxLabel); spawnbox(); } if(BoxSpawned == false) { BoxSpawned = true; spawnbox(); } } forward BoxSpawnCheck(); public BoxSpawnCheck() //I didn't know a better way XD { if (AdminBox == true) { Weaponbox(); } if (AdminBox == false && BoxSpawned == true) { Weaponbox(); return 1; } if (AdminBox == false && BoxSpawned == false) { // some function here for random box spawn //Changed to auto random spawn function. } return 1; } forward Weaponbox(); public Weaponbox() { for(new i = 0; i