Help with Arrays(?) - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Arrays(?) (
/showthread.php?tid=254278)
Help with Arrays(?) -
Skylar Paul - 10.05.2011
Line 72:
pawn Код:
new
Offer[MAX_PLAYERS][4] = -1;
pawn Код:
COMMAND:offertp(playerid, params[]) {
new
string[128],
Player;
if(sscanf(params, "u", Player)) {
UsageMessage(playerid, "OfferTP", "[Player ID]", "Offers a teleport to the specified user.");
return 1;
}
Offer[Player][0] = playerid;
return 1;
}
Getting the following errors -
Код:
C:\Users\Sky\Desktop\Work\Coding\sPAdmin\gamemodes\LVRP.pwn(72) : error 001: expected token: "{", but found "-"
C:\Users\Sky\Desktop\Work\Coding\sPAdmin\gamemodes\LVRP.pwn(72) : error 001: expected token: "}", but found ";"
Re: Help with Arrays(?) -
sciman001 - 10.05.2011
pawn Код:
new Offer[MAX_PLAYERS][4] =
{
-1
};
that maybe?
Re: Help with Arrays(?) -
Skylar Paul - 10.05.2011
Quote:
Originally Posted by sciman001
pawn Код:
new Offer[MAX_PLAYERS][4] = { -1 };
that maybe?
|
Doesn't seem to be.
Код:
C:\Users\Sky\Desktop\Work\Coding\sPAdmin\gamemodes\LVRP.pwn(77) : error 052: multi-dimensional arrays must be fully initialized
Re: Help with Arrays(?) -
sciman001 - 10.05.2011
pawn Код:
new Offer[MAX_PLAYERS][4] =
{
-1,
-1,
-1,
-1
};
Re: Help with Arrays(?) -
Kenoja - 10.05.2011
new
Offer[MAX_PLAYERS][4];
Offer[MAX_PLAYERS][0] = -1;
Offer[MAX_PLAYERS][1] = -1;
Offer[MAX_PLAYERS][2] = -1;
Offer[MAX_PLAYERS][3] = -1;
In arrays the count starts from 0.