Weird error? - 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: Weird error? (
/showthread.php?tid=475707)
Weird error? -
[WSF]ThA_Devil - 14.11.2013
Quote:
Originally Posted by [WSF]ThA_Devil
EDIT:
This made no sense, but fixed it :/
ShipInfo[veh][ShipModel][i] = 1;
|
Thanks everybody involved!
Re: Weird error? -
Elie1996 - 14.11.2013
Try to put this in your enum:
pawn Код:
enum sNfo {
ShipObject[64]
};
new ShipInfo[MAX_VEHICLES][sNfo];
Re: Weird error? -
[WSF]ThA_Devil - 14.11.2013
Quote:
Originally Posted by Elie1996
Try to put this in your enum:
pawn Код:
enum sNfo { ShipObject[64] }; new ShipInfo[MAX_VEHICLES][sNfo];
|
Not a single difference.
Re: Weird error? -
Elie1996 - 14.11.2013
pawn Код:
ShipInfo[veh][ShipObject[i]] = 1;
What is this "[i]".
Try to remove it.
Re: Weird error? -
[WSF]ThA_Devil - 14.11.2013
Quote:
Originally Posted by Elie1996
pawn Код:
ShipInfo[veh][ShipObject[i]] = 1;
What is this "[i]".
Try to remove it.
|
Код:
"i" was used in loop, and veh was vehicle before then.
It seems you didn't read all of it, I require a loop for that.
Re: Weird error? -
Elie1996 - 14.11.2013
Yeah, sorry. Maybe you need to update. Check this out, it might help you --->
https://sampforum.blast.hk/showthread.php?tid=384518
Quote:
The script was real messy with OnFilterScriptInit and Exit everywhere and other stuff, but i wanna try it out
|
Re: Weird error? -
Wizzy951 - 14.11.2013
Try changing:
pawn Код:
ShipInfo[veh][ShipObject[i]] = 1;
to
pawn Код:
ShipInfo[veh]ShipObject[i] = 1;
Re: Weird error? -
Elie1996 - 14.11.2013
Quote:
Originally Posted by Wizzy951
Try changing:
pawn Код:
ShipInfo[veh][ShipObject[i]] = 1;
to
pawn Код:
ShipInfo[veh][ShipObject[i] = 1;
|
Sorry, but that's entirely wrong, you have to close as many brackets as you've opened.
Re: Weird error? -
Biesmen - 14.11.2013
Quote:
Originally Posted by Wizzy951
Try changing:
pawn Код:
ShipInfo[veh][ShipObject[i]] = 1;
to
pawn Код:
ShipInfo[veh][ShipObject[i] = 1;
|
So, you're opening a bracket, but you don't close it?
Green = Open | Red = Closed
ShipInfo
[veh
][ShipObject
[i
] = 1;
Anyway, that array doesn't make sense at all.
You're defining the array on this way:
pawn Код:
new ShipInfo[MAX_VEHICLES][sNfo];
enum sNfo {
ShipObject[64]
}
Which means you can use it like this:
pawn Код:
ShipInfo[vehicleid][ShipObject] = "String with a max char of 64";
(Please correct me if I'm wrong.. I'm programming in four languages at this moment, I kinda get confused sometimes)
Re: Weird error? -
Wizzy951 - 14.11.2013
Quote:
Originally Posted by Biesmen
Which means you can use it like this:
pawn Код:
ShipInfo[vehicleid][ShipObject] = "String with a max char of 64";
(Please correct me if I'm wrong.. I'm programming in four languages at this moment, I kinda get confused sometimes)
|
He is using it in a loop, so
[i] stays for
[playerid] and he doesn't have to remove it.
Also check the edit of my first response on your topic.