new gFlintCountyZoneSpawn[][] = { {X,Y,Z}, {X,Y,Z}, {X,Y,Z} }; //And then make one for another spot? new gIdlewoodZoneSpawn[][] = { {X,Y,Z}, {X,Y,Z}, {X,Y,Z} }; public OnGameModeInit() { gRandomZoneTimer = SetTimer("ChangeRandomZone", 60000, true); return 1; } forward ChangeRandomZone(); public ChangeRandomZone() { ????????????????????????????? return 1; }
public OnPlayerConnect(playerid) { gDMRotation[playerid] = 0; return 1; // And then add in like a command to enter rotation? public OnPlayerCommandText(playerid, cmdtext[]) { new idx; new cmd[256]; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/Start", true) == 0) { gDMRotation[playerid] = 1; return 1; } return 0;
new gZoneSpawns[2][10][3] = { {"1244.6598,-2007.9690,59.8583"}, // #1 {"1263.8115,-2008.7446,59.3110"}, // #2 {"1274.2030,-2017.0784,59.0140"}, // #3 {"1275.0482,-2029.7145,59.0075"}, // #4 {"1267.9203,-2039.6437,59.1826"}, // #5 {"1257.5148,-2045.0038,59.4839"}, // #6 {"1248.4553,-2045.1805,59.7547"}, // #7 {"1241.6305,-2040.7483,60.0307"}, // #8 {"1237.1600,-2037.8246,60.4849"}, // #9 {"1231.9650,-2033.4900,62.9660"} // #10 {"-2634.5728,1352.5977,7.1206"}, // #1 {"-2628.7397,1356.4369,7.0964"}, // #2 {"-2626.7644,1364.8420,7.0882"}, // #3 {"-2635.1113,1367.3550,7.1229"}, // #4 {"-2638.3760,1359.6676,7.1364"}, // #5 {"-2633.6199,1351.5447,7.1167"}, // #6 {"-2624.4773,1349.3302,7.1448"}, // #7 {"-2616.0916,1347.4570,7.1953"}, // #8 {"-2613.6470,1355.6351,7.1460"}, // #9 {"-2605.9299,1360.8137,7.0848"} // #10 };
^ Is pretty much all I got I right now. How does the script know which of the 3d arrays above have to do with each area? Does it do it automaticly or? And thats just a small question I dont know how to continue after that
And where(how) do I create the dm mode? a #define? I dont even know what Im talking about right now. |
new order;
new bool:gDMRotation[MAX_PLAYERS];
new gZoneSpawns[][] =
{
//First spawn
{ 1244.6598, -2007.9690, 59.8583 }, // #0
{ 1263.8115, -2008.7446, 59.3110 }, // #1
{ 1274.2030, -2017.0784, 59.0140 }, // #2
{ 1275.0482, -2029.7145, 59.0075 }, // #3
{ 1267.9203, -2039.6437, 59.1826 }, // #4
{ 1257.5148, -2045.0038, 59.4839 }, // #5
{ 1248.4553, -2045.1805, 59.7547 }, // #6
{ 1241.6305, -2040.7483, 60.0307 }, // #7
{ 1237.1600, -2037.8246, 60.4849 }, // #8
{ 1231.9650, -2033.4900, 62.9660 }, // #9
//Second
{-2634.5728, 1352.5977, 7.1206 }, // #10
{-2628.7397, 1356.4369, 7.0964 }, // #11
{-2626.7644, 1364.8420, 7.0882 }, // #12
{-2635.1113, 1367.3550, 7.1229 }, // #13
{-2638.3760, 1359.6676, 7.1364 }, // #14
{-2633.6199, 1351.5447, 7.1167 }, // #15
{-2624.4773, 1349.3302, 7.1448 }, // #16
{-2616.0916, 1347.4570, 7.1953 }, // #17
{-2613.6470, 1355.6351, 7.1460 }, // #18
{-2605.9299, 1360.8137, 7.0848 } // #19
};
public OnGameModeInit()
{
order = 1;
gRandomZoneTimer = SetTimer("ChangeRandomZone", 60000, true);//a minute timer
return 1;
}
forward ChangeRandomZone();
public ChangeRandomZone()
{
//Sizeof returns the size of the array plus one for the EOS, so if we say we have 10 spawn each, we'll devide it by 10 (since it start counting from 0, if we have 20 spawn the actual sizeof array will be 20);
//if(++order > (sizeof(gZoneSpawns)) / 10) order = 1; //if you want to switch between thim in order use this
order = random(sizeof(gZoneSpawns) / 10);//If you want the order be random, use this, note that it might spawn you at the same DM, cause it's random
//order will be 0 or 1, since we only got 20 spawn.
return 1;
}
public OnPlayerConnect(playerid)
{
gDMRotation[playerid] = false;//Use bool instead of an integer
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/Start", true) == 0)
{
gDMRotation[playerid] = true;
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid)
{
if( gDMRotation[playerid] ) //if he enabled it
{
JoinRandomRotation(playerid);
}
else // if there are other deathmatch modes, put a case for them, if not, just spawn him where you want to.
{
//SetPlayerPos(playerid, x, y, z);
}
return 1;
}
JoinRandomDeathmatch(playerid)
{
new rnd = random(10+1); //A random spawn, you can make them spawn in order if you want.
SetPlayerPos(playerid, gZoneSpawn[order * rnd][0], gZoneSpawn[order * rnd][1], gZoneSpawn[order * rnd][2]);
//SetPlayerInterior(playerid, interiorid); If it's a diffrent interior, switch his interior.
return 1;
}