Help with Arrays(?)
#1

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 ";"
Reply
#2

pawn Код:
new Offer[MAX_PLAYERS][4] =
{
     -1
};
that maybe?
Reply
#3

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
Reply
#4

pawn Код:
new Offer[MAX_PLAYERS][4] =
{    
     -1,
     -1,
     -1,
     -1
};
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)