[pomoc] Niza

Započeo [IF] mariomako, Maj 16, 2011, 14:20:03 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skriptu koju koristim: Moji gamemode od 0
Detaljan opis problema: Napravio sam nizu od 4 clana i sve lepo zadajem vrednost od tip float ali kada koristim nalazi mi errore

Dio skripte:

// Clasovi ( skinovi )
new Float:spawn[4];
spawn[1]=1958.3783; // X POS
spawn[2]=1343.1572; // Y POS
spawn[3]=15.3746; // Z POS
spawn[4]=269.1425; // ANGLE // LINE 105
AddPlayerClass(0, spawn[1], spawn[2], spawn[3], spawn[4], 0, 0, 0, 0, 0, 0);
AddPlayerClass(1, spawn[1], spawn[2], spawn[3], spawn[4], 0, 0, 0, 0, 0, 0);
AddPlayerClass(2, spawn[1], spawn[2], spawn[3], spawn[4], 0, 0, 0, 0, 0, 0);
AddPlayerClass(7, spawn[1], spawn[2], spawn[3], spawn[4], 0, 0, 0, 0, 0, 0);
AddPlayerClass(9, spawn[1], spawn[2], spawn[3], spawn[4], 0, 0, 0, 0, 0, 0);


ove errore:

D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(105) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(106) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(107) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(108) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(109) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(110) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(111) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(112) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(113) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(114) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(115) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(116) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(117) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(118) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(119) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(120) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(121) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(122) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(123) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(124) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(125) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(126) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(127) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(128) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(129) : error 032: array index out of bounds (variable "spawn")
D:\Infinity DM Stunt\gamemodes\infinitygm.pwn(130) : error 032: array index out of bounds (variable "spawn")

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.



linija 105? msm odakle pocinju errori.. :/

Citat: Lane_Hudson poslato Maj 16, 2011, 15:59:07 POSLE PODNE
linija 105? msm odakle pocinju errori.. :/

spawn[4]=269.1425; // ANGLE // LINE 105

Kad si uzeo  Array od [4] u ovaj slucaj spawn[4] .... koristis od spawn[0..3] to su 4 broja 4 je van dometa .. u tom slucaju trebace ti array[5]...

Citat: #InphiniteGamer poslato Maj 16, 2011, 17:05:27 POSLE PODNE
Kad si uzeo  Array od [4] u ovaj slucaj spawn[4] .... koristis od spawn[0..3] to su 4 broja 4 je van dometa .. u tom slucaju trebace ti array[5]...

hvala, moze lock :D