SA-MP Forums Archive
Help for new Eventai[][]= - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help for new Eventai[][]= (/showthread.php?tid=288827)



Help for new Eventai[][]= - Stuneris - 09.10.2011

Hi all,
I have errors:

Код:
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(226) : error 001: expected token: ",", but found "]"
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(226) : error 033: array must be indexed (variable "Pav")
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(227) : error 001: expected token: ",", but found "]"
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(228) : error 001: expected token: ",", but found "]"
Var:

Код:
new Koks, Prizas, Pav[128];
new Eventai[][]=
{
	{"Iљlikimo su Sawn-off shotgun", 10000, 1}, //26
	{"Iљlikimo su Micro Uzi (Mac 10)", 20000, 2}, //28
	{"Iљlikimo su Rpg", 5000, 3}, //35
	{"Iљlikimo su Country rifle", 15000, 4} //33
};
And using:

Код:
Pav = Eventai[random(sizeof(Eventai)][0];
	Prizas = Eventai[random(sizeof(Eventai)][1];
 	Koks = Eventai[random(sizeof(Eventai)][2];
Please help


Re: Help for new Eventai[][]= - nilanjay - 09.10.2011

Can you put that in english?


Re: Help for new Eventai[][]= - Karlip - 09.10.2011

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
Can you put that in english?
That is English.
pawn Код:
Pav = Eventai[random(sizeof(Eventai)][0];
Prizas = Eventai[random(sizeof(Eventai)][1];
 Koks = Eventai[random(sizeof(Eventai)][2];
^ You're missing a " ) "

pawn Код:
Pav = Eventai[random(sizeof(Eventai))][0];
Prizas = Eventai[random(sizeof(Eventai))][1];
Koks = Eventai[random(sizeof(Eventai))][2];



Re: Help for new Eventai[][]= - Stuneris - 09.10.2011

Quote:
Originally Posted by Karlip
Посмотреть сообщение
That is English.
pawn Код:
Pav = Eventai[random(sizeof(Eventai)][0];
Prizas = Eventai[random(sizeof(Eventai)][1];
 Koks = Eventai[random(sizeof(Eventai)][2];
^ You're missing a " ) "

pawn Код:
Pav = Eventai[random(sizeof(Eventai))][0];
Prizas = Eventai[random(sizeof(Eventai))][1];
Koks = Eventai[random(sizeof(Eventai))][2];
thx now left:

Код:
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(64) : error 033: array must be indexed (variable "Pav")



Re: Help for new Eventai[][]= - Wesley221 - 09.10.2011

pawn Код:
new Eventai[4][3]= // the [4] will be for the amount of weapons you listed in there
// the 3 is for the first, second and 3rd case between the '{ }'
{
    {"Išlikimo su Sawn-off shotgun", 10000, 1}, //26
    {"Išlikimo su Micro Uzi (Mac 10)", 20000, 2}, //28
    {"Išlikimo su Rpg", 5000, 3}, //35
    {"Išlikimo su Country rifle", 15000, 4} //33
};
Try that, that should work if im right


Re: Help for new Eventai[][]= - Stuneris - 09.10.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
pawn Код:
new Eventai[4][3]= // the [4] will be for the amount of weapons you listed in there
// the 3 is for the first, second and 3rd case between the '{ }'
{
    {"Iљlikimo su Sawn-off shotgun", 10000, 1}, //26
    {"Iљlikimo su Micro Uzi (Mac 10)", 20000, 2}, //28
    {"Iљlikimo su Rpg", 5000, 3}, //35
    {"Iљlikimo su Country rifle", 15000, 4} //33
};
Try that, that should work if im right
now:

Код:
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(18) : error 018: initialization data exceeds declared size
C:\Documents and Settings\Vartotojas\Desktop\Old Stunting World\filterscripts\events.pwn(64) : error 033: array must be indexed (variable "Pav")
error from:

Код:
Pav = Eventai[random(sizeof(Eventai))][0];