#1

Hi, how do i make like ahm.. there is 9 "rounds" and it repeats it self again and again, and ahumm i got the coordinates


Of all the rounds but how do i .. how to explain.. like not a round like ahmm who plays gtat knows


Let me try again, 9 places, if it place 1 it spawns everyone there if it place ...5 it spawns everyone there. how do i make it?


All pos
PHP код:
    //FIRST ROUND
    
AddPlayerClass(10,2190.7234,-1110.0210,24.7336,256.0660,0,0,0,0,0,0); //
    
AddPlayerClass(11,2216.2837,-1116.3627,25.1593,256.0660,0,0,0,0,0,0); //
    
AddPlayerClass(12,2235.1389,-1117.5103,48.8995,76.0660,0,0,0,0,0,0); //
    
AddPlayerClass(13,2228.2966,-1179.8988,29.0236,66.8109,0,0,0,0,0,0); //
    
AddPlayerClass(14,2205.8713,-1143.2073,33.7144,116.6313,0,0,0,0,0,0); //
    //SECOND ROUND
    
AddPlayerClass(15,2218.4468,-1486.3339,23.3469,344.4268,0,0,0,0,0,0); //
    
AddPlayerClass(16,2218.9084,-1469.5232,23.3469,334.0868,0,0,0,0,0,0); //
    
AddPlayerClass(17,2268.3176,-1453.8245,23.3469,334.0868,0,0,0,0,0,0); //
    
AddPlayerClass(18,2236.6890,-1418.1398,23.3469,68.4010,0,0,0,0,0,0); //
    
AddPlayerClass(19,2242.2947,-1399.7920,28.0080,171.3202,0,0,0,0,0,0); //
    //THIRD ROUND
    
AddPlayerClass(20,2497.9880,-1671.8606,13.2996,193.3987,0,0,0,0,0,0); //
    
AddPlayerClass(230,2507.1909,-1695.7240,17.1890,13.3987,0,0,0,0,0,0); //
    
AddPlayerClass(237,2521.2021,-1694.9813,18.6443,301.4997,0,0,0,0,0,0); //
    
AddPlayerClass(108,2527.4331,-1674.3792,19.8138,211.4997,0,0,0,0,0,0); //
    //4RD ROUND
    
AddPlayerClass(109,1478.1475,-939.3384,36.3919,104.2896,0,0,0,0,0,0); //
    
AddPlayerClass(122,1480.1812,-974.0552,36.3935,228.2023,0,0,0,0,0,0); //
    
AddPlayerClass(143,1496.9419,-959.9918,36.3935,298.0763,0,0,0,0,0,0); //
    
AddPlayerClass(149,1467.1119,-921.0645,50.7551,235.4325,0,0,0,0,0,0); //
    
AddPlayerClass(162,1455.3276,-974.4197,57.5156,156.6168,0,0,0,0,0,0); //
    //5RD ROUND
    
AddPlayerClass(265,1282.9596,-785.7844,96.4609,224.4658,0,0,0,0,0,0); //
    
AddPlayerClass(199,1248.1968,-790.6843,90.1172,255.6310,0,0,0,0,0,0); //
    
AddPlayerClass(200,1266.2073,-797.4693,87.8896,99.9263,0,0,0,0,0,0); //
    
AddPlayerClass(133,1289.8915,-827.7415,82.7706,7.1788,0,0,0,0,0,0); //
    //6RD ROUND
    
AddPlayerClass(141,1795.3051,-1919.6136,13.1590,67.6291,0,0,0,0,0,0); //
    
AddPlayerClass(111,1815.6787,-1922.0646,13.1590,265.4893,0,0,0,0,0,0); //
    
AddPlayerClass(231,1796.5142,-1946.0426,13.1590,284.6028,0,0,0,0,0,0); //
    
AddPlayerClass(232,1835.1029,-1929.6407,13.1590,88.1644,0,0,0,0,0,0); //
    //7RD ROUND
    
AddPlayerClass(233,2897.1084,-1045.3507,11.0469,297.4496,0,0,0,0,0,0); //
    
AddPlayerClass(254,2896.3860,-1017.3220,11.0469,3.8769,0,0,0,0,0,0); //
    
AddPlayerClass(264,2865.6375,-1007.2288,11.0469,160.8584,0,0,0,0,0,0); //
    
AddPlayerClass(272,2886.4546,-1036.3995,11.0469,237.6258,0,0,0,0,0,0); //
    
AddPlayerClass(265,2877.9414,-1064.3646,11.0469,236.9991,0,0,0,0,0,0); //
    //8RD ROUND
    
AddPlayerClass(0,1259.7389,244.6128,31.7004,323.1665,0,0,0,0,0,0); //
    
AddPlayerClass(1,1268.2799,256.0161,19.1344,143.1665,0,0,0,0,0,0); //
    
AddPlayerClass(2,1296.9725,274.5328,19.1344,335.3866,0,0,0,0,0,0); //
    
AddPlayerClass(3,1262.2065,208.8077,19.1344,154.2782,0,0,0,0,0,0); //
    
AddPlayerClass(4,1216.0251,200.5712,19.1344,72.8108,0,0,0,0,0,0); //
    
AddPlayerClass(5,1233.9474,240.1653,19.1344,331.9165,0,0,0,0,0,0); //
    //9RD ROUND
    
AddPlayerClass(6,1074.3838,-313.5328,73.9922,170.2350,0,0,0,0,0,0); //
    
AddPlayerClass(7,1029.5439,-335.0949,73.9922,116.3412,0,0,0,0,0,0); //
    
AddPlayerClass(8,1043.6953,-298.9853,73.9922,270.1659,0,0,0,0,0,0); //
    
AddPlayerClass(9,1046.5494,-292.5767,77.2287,356.6468,0,0,0,0,0,0); //
    
AddPlayerClass(25,1019.5790,-307.8586,77.2287,19.2070,0,0,0,0,0,0); //
    
AddPlayerClass(28,1028.8607,-348.2612,73.2106,24.0754,0,0,0,0,0,0); // 
Reply
#2

Don't understand you fully but.. if you want it to spawn them on each round you'll need a global variable, something like this:
pawn Код:
new Round;
To change round you can use this, which will up the value by 1:

pawn Код:
Round++;
And whenever the round changes, you spawn them in the desired locations.
Reply
#3

no, i mean i want it like the round to be 10 mintutes then it'll change round idk how
Reply
#4

Oh, so you'll need a timer for that. Create a function by forwarding it first, so like this:

pawn Код:
forward RoundTimer();

public RoundTimer()
{
    return 1;
}
Use the SetTimerEx function to set the timer, remember 1 second is 1000 ticks.
Reply
#5

I got no idea what to do after i do this idk what to do after and what to do with the coordinates, NOTHING AT ALL
Reply
#6

When the game starts (teleports the players to the game), you START the timer, once it ends (after 10 minutes) you use the global variable:

pawn Код:
Round++;
And after another 10 minutes (using a timer), up the round by one again and teleport them. I won't do it for you.
Reply
#7

Just made this for you, you can use it as a template although I'm not entirely sure whether everything is done efficiently or not. I've tried to be as efficient as possible though. Compiles, but has not been tested so it may not work but this should give you an idea of how it should look like.

pawn Код:
#include <a_samp>
#include <foreach>

#define MAX_ROUND_TIME      (900000) // 15 min

new Round;

enum RoundInfo
{
    RoundID,
    SkinID,
   
    Float: RoundX,
    Float: RoundY,
    Float: RoundZ,
    Float: RoundA
};

new RoundArray[][RoundInfo] =
{
    //FIRST ROUND
    {0, 10, 2190.7234, -1110.0210, 24.7336, 256.0660},  {0, 11, 2216.2837, -1116.3627, 25.1593, 256.0660},
    {0, 12, 2235.1389, -1117.5103, 48.8995, 76.0660},   {0, 13, 2228.2966, -1179.8988, 29.0236, 66.8109},
    {0, 14, 2205.8713, -1143.2073, 33.7144, 116.6313},

    //SECOND ROUND
    {1, 15, 2218.4468, -1486.3339, 23.3469, 344.4268},  {1, 16, 2218.9084, -1469.5232, 23.3469, 334.0868},
    {1, 17, 2268.3176, -1453.8245, 23.3469, 334.0868},  {1, 18, 2236.6890, -1418.1398, 23.3469, 68.4010},
    {1, 19, 2242.2947, -1399.7920, 28.0080, 171.3202},

    //THIRD ROUND
    {2, 20, 2497.9880, -1671.8606, 13.2996, 193.3987},  {2, 230, 2507.1909, -1695.7240, 17.1890, 13.3987},
    {2, 237, 2521.2021, -1694.9813, 18.6443, 301.4997}, {2, 108, 2527.4331, -1674.3792, 19.8138, 211.4997},

    //4RD ROUND
    {3, 109, 1478.1475, -939.3384, 36.3919, 104.2896},  {3, 122, 1480.1812, -974.0552, 36.3935, 228.2023},
    {3, 143, 1496.9419, -959.9918, 36.3935, 298.0763},  {3, 149, 1467.1119, -921.0645, 50.7551, 235.4325},
    {3, 162, 1455.3276, -974.4197, 57.5156, 156.6168},

    //5RD ROUND
    {4, 265, 1282.9596, -785.7844, 96.4609, 224.4658},  {4, 199, 1248.1968, -790.6843, 90.1172, 255.6310},
    {4, 200, 1266.2073, -797.4693, 87.8896, 99.9263},   {4, 133, 1289.8915, -827.7415, 82.7706, 7.1788},

    //6RD ROUND
    {5, 141, 1795.3051, -1919.6136, 13.1590, 67.6291},  {5, 111, 1815.6787, -1922.0646, 13.1590, 265.4893},
    {5, 231, 1796.5142, -1946.0426, 13.1590, 284.6028}, {5, 232, 1835.1029, -1929.6407, 13.1590, 88.1644},

    //7RD ROUND
    {6, 233, 2897.1084, -1045.3507, 11.0469, 297.4496}, {6, 254, 2896.3860, -1017.3220, 11.0469, 3.8769},
    {6, 264, 2865.6375, -1007.2288, 11.0469, 160.8584}, {6, 272, 2886.4546, -1036.3995, 11.0469, 237.6258},
    {6, 265, 2877.9414, -1064.3646, 11.0469, 236.9991},

    //8RD ROUND
    {7, 0, 1259.7389, 244.6128, 31.7004, 323.1665},     {7, 1, 1268.2799, 256.0161, 19.1344, 143.1665},
    {7, 2, 1296.9725, 274.5328, 19.1344, 335.3866},     {7, 3, 1262.2065, 208.8077, 19.1344, 154.2782},
    {7, 4, 1216.0251, 200.5712, 19.1344, 72.8108},      {7, 5, 1233.9474, 240.1653, 19.1344, 331.9165},

    //9RD ROUND
    {8, 6, 1074.3838, -313.5328, 73.9922, 170.2350},    {8, 7, 1029.5439, -335.0949, 73.9922, 116.3412},
    {8, 8, 1043.6953, -298.9853, 73.9922, 270.1659},    {8, 9, 1046.5494, -292.5767, 77.2287, 356.6468},
    {8, 25, 1019.5790, -307.8586, 77.2287, 19.2070},    {8, 28, 1028.8607, -348.2612, 73.2106, 24.0754}
};

main()
{
    printf("Server Started!");
    SetTimer("RoundTimer", MAX_ROUND_TIME, true);
}

public OnPlayerSpawn(playerid)
{
    new locations;

    switch(Round)
    {
        case 0 .. 1, 3, 6: locations = 5;
        case 2, 4 .. 5: locations = 4;
        case 7 .. 8: locations = 6;
    }

    for(new i; i < sizeof(RoundArray); i ++)
    {
        if(RoundArray[i][RoundID] == Round)
        {
            new randsp = random(locations);
       
            SetPlayerPos(playerid, RoundArray[randsp][RoundX], RoundArray[randsp][RoundY], RoundArray[randsp][RoundZ]);
            SetPlayerFacingAngle(playerid, RoundArray[randsp][RoundA]);
           
            SetPlayerSkin(playerid, RoundArray[i][SkinID]);
        }
    }

    return true;
}

forward RoundTimer();
public RoundTimer()
{
    new MAX_ROUNDS = RoundArray[sizeof(RoundArray) - 1][RoundID];

    if(++ Round < MAX_ROUNDS)
        SendClientMessageToAll(-1, "Round has ended! Starting new round...");

    else if(Round >= MAX_ROUNDS)
        Round = 0;

    foreach(new i: Player)
    {
        if(IsPlayerConnected(i))
        {
            SpawnPlayer(i);
        }
    }

    return true;
}
EDIT: Updated
Reply
#8

untested, but should work like a charm
pawn Код:
new cords[][] {
  {0,0,0,0}, // round 0
  {0,0,0,0}, // round 1
  {0,0,0,0}, // round 2
  {0,0,0,0}  // round 3
}
new
  round,
  timer
;
public onGameModeInit() {
  timer=SetTimer("round", 600000, 1);
}
public OnGameModeExit() {
  KillTimer(timer);
}
forward round();
public round() {
  ClearRoundObjects(round);
  if(round==3) {
    round=0;
  }else{
    round++;
  }
  CreateRoundObjects(round);
  RespawnAll();
}
ClearRoundObjects(round) {
  switch(round) {
    case 0: {}
    case 1: {}
    case 2: {}
    case 3: {}
  }
}
CreateRoundObjects(round) {
  switch(round) {
    case 0: {}
    case 1: {}
    case 2: {}
    case 3: {}
  }
}
RespawnAll() {
  // Will be faster to check once than make a loop and check for each player
  switch(round) {
    case 0: {
      new id=0;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(cords[id][3]);
      }
    }
    case 1: {
      new id=1;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(cords[id][3]);
      }
    }
    case 2: {
      new id=2;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(cords[id][3]);
      }
    }
    case 3: {
      new id=3;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(cords[id][3]);
      }
    }
}
Reply
#9

Код:
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(152) : error 010: invalid function or declaration
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(260) : error 017: undefined symbol "timer"
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(264) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(265) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(266) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(266) : warning 215: expression has no effect
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(268) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(268) : warning 215: expression has no effect
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(270) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(291) : error 076: syntax error in the expression, or invalid function call
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(295) : error 017: undefined symbol "cords"
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(295) : warning 215: expression has no effect
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(295) : error 001: expected token: ";", but found "]"
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(295) : error 029: invalid expression, assumed zero
C:\Users\yan\Desktop\Scripting tests\gamemodes\LS-DM.pwn(295) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
@Kaperstone those are the errors

And mionee it was the same but thanks for helpin tho
Reply
#10

I can compile my code just fine without any errors, so you clearly did something wrong.

Here's Kaperstone's code fixed (also not tested, but I did fix the errors for you):

pawn Код:
#include <a_samp>
#include <foreach>

new cords[][] = {
  {0,0,0,0}, // round 0
  {0,0,0,0}, // round 1
  {0,0,0,0}, // round 2
  {0,0,0,0}  // round 3
};
new
  round,
  timer
;
public OnGameModeInit() {
  timer=SetTimer("roundtick", 600000, 1);
  return 1;
}
public OnGameModeExit() {
  KillTimer(timer);
  return 1;
}
forward roundtick();
public roundtick() {
  ClearRoundObjects(round);
  if(round==3) {
    round=0;
  }else{
    round++;
  }
  CreateRoundObjects(round);
  RespawnAll();
}
ClearRoundObjects(roundx) {
  switch(roundx) {
    case 0: {}
    case 1: {}
    case 2: {}
    case 3: {}
  }
}
CreateRoundObjects(roundx) {
  switch(roundx) {
    case 0: {}
    case 1: {}
    case 2: {}
    case 3: {}
  }
}
RespawnAll() {
  // Will be faster to check once than make a loop and check for each player
  switch(round) {
    case 0: {
      new id=0;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(i, cords[id][3]);
      }
    }
    case 1: {
      new id=1;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(i, cords[id][3]);
      }
    }
    case 2: {
      new id=2;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(i, cords[id][3]);
      }
    }
    case 3: {
      new id=3;
      foreach(new i : Player) {
        SetPlayerPos(i, cords[id][0], cords[id][1], cords[id][2]);
        SetPlayerFacingAngle(i, cords[id][3]);
      }
    }
  }
}
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)