Looping through 2D variable
#1

Hey there!

I'm trying to create a command that will give you some specific weapons (their ID's).
I'm having a problem that the pawno does't recognize the var and I don't know why..
What am I doing wrong here? Am I coding the variable wrong?

PHP код:
CMD:spawnweapons(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= && Logged[playerid])
    {
        new 
weaponlist[] = { 242731343543 };
        for(new 
0sizeof(weaponlist); i++) //<- line 2413
        
{
            
GivePlayerWeapon(playeridi10010);
        }
        
GameTextForPlayer(playerid,"~w~Weapons ~g~Gained"50001);
    }
    else return 
SendErrorMessage(playeridERROR_ADMIN);
    return 
1;

PHP код:
GameModes.pwn(2413) : warning 204symbol is assigned a value that is never used"weaponlist" 
Reply
#2

It does recognize it alright, it just tells you that you created a variable but didn't use it.

pawn Код:
GivePlayerWeapon(playerid, i, 10010);
That will just give the player weapons with ids 0 through 5. Not the ones that you specified.

pawn Код:
GivePlayerWeapon(playerid, weaponlist[i], 10010);
Reply
#3

I understand my mistake. Silly me hehe
Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)