Lol, thx for the support? I don't think it's exactly what he wants but I could give him the lego box after I fix it up a bit more. The maze-gen is nowhere near complete.
Before I give you the Lego Box, you can try this little mini-mode I made a while back (but upgraded to 0.3.7 RC2 cubes just now). The objective is to be the last player above water. It's not a complete script or anything but yeah.
Code:
#include <a_samp>
#include <YSI\y_iterate>
#include <YSI\y_inline>
main(){}
#define SIZE 2
#define SPACING 0.0
#define INTERVAL 50
new Iterator:Object<(SIZE*SIZE)+1>,
Iterator:PlayersIn<MAX_PLAYERS+1>,
Warned[MAX_PLAYERS],
Timer:Updater;
public OnGameModeInit()
{
Reset();
return 1;
}
/*GetObject(&output)
{
new playerid = Iter_Random(PlayersIn);
foreach(new objectid: Object)
{
new Float:P[3];
GetObjectPos(objectid, P[0], P[1], P[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, P[0], P[1], P[2]))
{
output = objectid;
break;
}
}
}*/
forward Update(); public Update()
{
if(!Iter_Count(PlayersIn))
{
Updater = Timer:SetTimer("Update", INTERVAL, 0);
return 1;
}
new rand = Iter_Random(Object), count = Iter_Count(Object);
/*new playerid = Iter_Random(PlayersIn);
inline(&rand)
{
foreach(new objectid: Object)
{
new Float:P[3];
GetObjectPos(objectid, P[0], P[1], P[2]);
if(IsPlayerInRangeOfPoint(playerid, 2.0, P[0], P[1], P[2]))
{
output = objectid;
break;
}
}
}
rand = random(2) ? rand : using inline;*/
if(!count) Reset();
else if(IsObjectMoving(rand)) while(IsObjectMoving(rand)) rand = Iter_Random(Object);
else
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(rand, X, Y, Z);
MoveObject(rand, X, Y, Z-11.0, 2.5);
//MoveObject(rand, X, Y, Z-5.0, 3.75);
}
return 1;
}
Reset()
{
KillTimer(_:Updater);
foreach(new i : Object)
DestroyObject(i);
Iter_Clear(Object);
for(new x; x<SIZE*(GetPlayerPoolSize()+2); x++) for(new y; y<SIZE*(GetPlayerPoolSize()+2); y++)
{
new obj = CreateObject(1685, (x*(1.75+SPACING))-(SIZE/2)+(-785.0000), (y*(1.75+SPACING))-(SIZE/2)+(485.0000), 10.0, 0.0, 0.0, 0.0);
//new obj = CreateObject(19789, (x*(1+SPACING))-(SIZE/2)+(-785.0000), (y*(1+SPACING))-(SIZE/2)+(485.0000), 4.0, 0.0, 0.0, 0.0);
if(IsValidObject(obj))
{
Iter_Add(Object, obj);
switch((Iter_Count(Object) % 4))
{
case 0: SetObjectMaterialText(obj, " ", .backcolor = 0xFFFF0000);
case 1: SetObjectMaterialText(obj, " ", .backcolor = 0xFFFFFF00);
case 2: SetObjectMaterialText(obj, " ", .backcolor = 0xFF00FF00);
case 3: SetObjectMaterialText(obj, " ", .backcolor = 0xFF0000FF);
}
}
}
Updater = Timer:SetTimer("Update", INTERVAL, 0);
return 1;
}
public OnObjectMoved(objectid)
{
DestroyObject(objectid);
Iter_Remove(Object, objectid);
Updater = Timer:SetTimer("Update", INTERVAL, 0);
return 1;
}
public OnPlayerSpawn(playerid)
{
new Float:X, Float:Y, Float:Z, rand = Iter_Random(Object);
// while(IsObjectMoving(rand)) rand = Iter_Random(Object);
GetObjectPos(rand, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z+1.75);
Warned[playerid] = INVALID_OBJECT_ID;
return 1;
}
public OnPlayerUpdate(playerid)
{
new objectid = GetPlayerSurfingObjectID(playerid), count = Iter_Count(PlayersIn), Float:z;
GetPlayerPos(playerid, z, z, z);
if(objectid != INVALID_OBJECT_ID && Warned[playerid] != objectid)
{
Warned[playerid] = objectid;
SendClientMessage(playerid, -1, "This block is falling, save yourself!");
}
else if(z < 0.0)
{
SpawnPlayer(playerid);
Iter_Remove(PlayersIn, playerid);
switch(count)
{
case 1:
{
SendClientMessage(playerid, -1, "FIRST PLACE");
Reset();
}
case 2: SendClientMessage(playerid, -1, "SECOND PLACE");
case 3: SendClientMessage(playerid, -1, "THIRD PLACE");
}
SetPlayerScore(playerid, (Iter_Count(Object) == 1 ? 5000 : ((SIZE*SIZE)-Iter_Count(Object)))+GetPlayerScore(playerid));
}
else if(!Iter_Contains(PlayersIn, playerid))
{
Iter_Add(PlayersIn, playerid);
}
return 1;
}