SA-MP Forums Archive
Am I doing this right? - 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: Am I doing this right? (/showthread.php?tid=304255)



Am I doing this right? - Scarred - 17.12.2011

pawn Код:
new
        weapons[13][2] //Creating the variable for the data.
    ;

    for (new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); //Getting the data.
        UserInfo[playerid][w_Slot1] = weapons[1][0]; //Trying to update Weapon Slot 1's Weapon ID.
        UserInfo[playerid][w_Slot1A] = weapons[1][1]; // Trying to update Weapon Slot 1's Ammo count.
    }
I'm honestly not sure, and I'm not at a PC where I can test at the moment, so I'd like to know - am I doing this right?


Re: Am I doing this right? - Ash. - 17.12.2011

Take the assignation of "UserInfo[playerid][...]" (both) out of the loop - and put them below. There's no point in doing the same thing 13 times

Other than that, that'll be fine.


Re: Am I doing this right? - Scarred - 17.12.2011

Quote:
Originally Posted by funky1234
Посмотреть сообщение
Take the assignation of "UserInfo[playerid][...]" (both) out of the loop - and put them below. There's no point in doing the same thing 13 times

Other than that, that'll be fine.
Oh jeez, it must've slipped my mind. Thank you!