pawno crashing
#1

Hey my pawno keeps crashing when I add this code in a timer:

pawn Код:
new Random = random(sizeof(Spawns));
    Gascan = CreateObject(1650, Spawns[Random][0], Spawns[Random][1], Spawns[Random][2], 0, 0.0000000,0.0000000);
If i remove it from the timer, then it won't crash but gives me an error saying it has no function.

pawn Код:
forward RespawnGas();
public RespawnGas()
{
      for(new i = 0; i < sizeof(Gascan); i ++)
      {
          DestroyObject(Gascan);
      }
      new Random = random(sizeof(Spawns));
      Gascan = CreateObject(1650, Spawns[Random][0], Spawns[Random][1], Spawns[Random][2], 0, 0.0000000,0.0000000);
}
pawn Код:
new Float:Spawns[][] =
{
    {3306.6553,1259.8336,2.1172},
    {3328.7737,1267.0488,7.5796},
    {3328.7737,1267.0488,7.5796},
    {3337.5103,1260.8734,2.7230},
    {3357.1526,1254.6317,3.4480},
    {3360.0459,1256.7892,3.7224},
    {3358.5715,1265.0615,3.7148},
    {3385.4182,1257.8749,2.3178},
    {3404.7632,1250.3076,3.6106},
    {3406.3801,1248.5397,2.1172},
    {3405.8450,1266.9727,2.1172},
    {3403.1255,1268.1980,12.9666},
    {3391.8633,1265.1554,7.9231},
    {3392.4270,1236.6273,5.6106},
    {3393.7185,1245.5343,11.5403},
    {3407.0439,1238.3799,11.5403},
    {3407.1978,1235.4758,6.4700},
    {3408.3953,1229.6116,6.4700},
    {3397.4553,1234.2732,6.4700},
    {3413.5886,1214.9233,12.2036},
    {3411.7473,1205.1986,7.8137},
    {3411.7473,1205.1986,7.8137},
    {3411.7473,1205.1986,7.8137},
    {3411.7473,1205.1986,7.8137},
    {3411.7473,1205.1986,7.8137},
    {3410.8142,1192.7043,10.1234},
    {3410.8142,1192.7043,10.1234},
    {3403.9678,1203.4491,3.1336},
    {3417.0454,1167.8691,2.1172},
    {3413.7224,1163.1210,7.5896},
    {3373.1477,1112.1410,3.5828},
    {3337.2666,1117.6179,2.4718},
    {3318.4917,1110.9222,3.7542},
    {3318.4917,1110.9222,3.7542},
    {3316.9573,1133.8853,2.0078},
    {3316.9573,1133.8853,2.0078},
    {3313.1758,1254.8231,2.1172},
    {3313.2124,1254.5273,2.1172},
    {3316.7974,1255.1503,2.1172},
    {3316.7974,1255.1503,2.1172},
    {3316.2917,1258.4985,2.1172},
    {3316.2917,1258.4985,2.1172},
    {3310.6448,1213.6329,2.3782},
    {3360.9504,1240.4778,6.6492},
    {3360.3369,1251.2625,7.7296},
    {3363.5681,1220.4398,6.6492},
    {3370.0681,1211.3550,12.3573},
    {3369.6860,1211.2639,12.3076},
    {3369.6860,1211.2639,12.3076},
    {3364.5281,1203.7407,2.3461},
    {3292.1360,1160.5769,1.5175}
};
I have this on ongamemodeinit

pawn Код:
new Random = random(sizeof(Spawns));
    Gascan = CreateObject(1650, Spawns[Random][0], Spawns[Random][1], Spawns[Random][2], 0, 0.0000000,0.0000000);
Reply
#2

Nevermind, for some reason after 10-15 compiles of it crashing, it has now worked.... odd...
Reply
#3

EDIT:nvm, user resolved it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)