Explain to me line I do not understand PLS
#1

UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])] = WeaponList[GunNum][WID];

what this line say ? what value gets each variable ?

TNX guys
Reply
#2

UserData - enum
playerid - the player that is getting the value
Guns - the field you want to store the variable
Guns (Array) - Holds the value for each gun (weapon)
GetWeaponSlot - Getting the weapon slot of the weapon id stored in WeaponList[GunNum][WID]

= - Telling the player's variable to store the following into it.

WeaponList[GunNum][WID] - The weapon id to store in the Gun Array in that weapons slot.

So with that above, marked:

UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])] = WeaponList[GunNum][WID];
enum-----playerid---Guns-----Guns(Array)----GetWeaponSlot----Weapon id-----Weapon ID to store

(Forums don't like spaces)

PHP код:
UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])] = WeaponList[GunNum][WID];
UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])]
//This is getting the value of 
WeaponList[GunNum][WID
So pretty much, you're saving the weapon id into the player's enumerator data, by the weapon slot, the slot id will hold the weapon id.
Reply
#3

Quote:
Originally Posted by Banana_Ghost
Посмотреть сообщение
UserData - enum
playerid - the player that is getting the value
Guns - the field you want to store the variable
Guns (Array) - Holds the value for each gun (weapon)
GetWeaponSlot - Getting the weapon slot of the weapon id stored in WeaponList[GunNum][WID]

= - Telling the player's variable to store the following into it.

WeaponList[GunNum][WID] - The weapon id to store in the Gun Array in that weapons slot.

So with that above, marked:

UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])] = WeaponList[GunNum][WID];
enum-----playerid---Guns-----Guns(Array)----GetWeaponSlot----Weapon id-----Weapon ID to store

(Forums don't like spaces)

PHP код:
UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])] = WeaponList[GunNum][WID];
UserData[playerid][Guns][GetWeaponSlot(WeaponList[GunNum][WID])]
//This is getting the value of 
WeaponList[GunNum][WID
So pretty much, you're saving the weapon id into the player's enumerator data, by the weapon slot, the slot id will hold the weapon id.
thank you so much man!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)