How to define ''Weapons''
#1

I need to define it but I dont know how. So please, I appreciate all help.
The line:
pawn Код:
stock GetWeaponParam(id, WeaponsEnum: param)
{
    for (new  = 0, i < MAX_WEAPONS, i++);
    {
        if (Weapons[x][WeaponId] == id) return Weapons[x][param];
    }
    return 0;
}
The 3 errors:
pawn Код:
error 021: symbol already defined: "i"
error 017: undefined symbol "Weapons"
error 036: empty statement
I hope someone can help me.
Reply
#2

First of all, remove the semicolon behind the for line and replace the commas with semicolons.
Reply
#3

I did. Now:
The command looks:
pawn Код:
stock GetWeaponParam(id, WeaponsEnum: param)
{
    for (new  = 0; i < MAX_WEAPONS, i++); // Line 33534
    {
        if (Weapons[x][WeaponId] == id) return Weapons[x][param]; // Line 33536
    }
    return 0;
}
New errors showed up:
pawn Код:
(33534) : error 001: expected token: "-identifier-", but found "="
(33536) : error 029: invalid expression, assumed zero
(33536) : error 017: undefined symbol "x"
(33536) : error 029: invalid expression, assumed zero
(33536) : fatal error 107: too many error messages on one line
Reply
#4

Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
I did. Now:
New errors showed up
Try this to fix the last errors
pawn Код:
stock GetWeaponParam(id, WeaponsEnum: param)
{
    for (new X = 0, X < MAX_WEAPONS, X++);
    {
        if (Weapons[X][WeaponId] == id) return Weapons[X][param];
    }
    return 0;
}
And about the..
Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
The 3 errors:
pawn Код:
error 021: symbol already defined: "i"
error 017: undefined symbol "Weapons"
error 036: empty statement
Did you make the Weapons enum? i don't really get what you want to do.
Reply
#5

I didn't make made the Weapons enum because I don't know how, so can you write here how please?
Reply
#6

pawn Код:
(33534) : error 021: symbol already defined: "X"
(33534) : error 036: empty statement
(33534) : error 017: undefined symbol "Weapons"
(33534 -- 33536) : fatal error 107: too many error messages on one line
One error has been fixed. Well, I believe it to create the Weapon Enum, but I dont know how,.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)