Resto Posted August 24, 2015 Posted August 24, 2015 hi i have here this: Skin: ID guiSetText ( aTab1.Skin, "Skin: "..iif ( getElementModel ( player ), getElementModel ( player ), "N/A" ) ) and when i want to if getPlayerSkin ( 70 ) == Good Skin elseif getPlayerSkin ( 100 ) == Noob Skin elseif getPlayerSkin ( 50 ) == Idiot Skin Good Skin = Name Noob Skin = Name Idiot Skin = Name example: ID 0 = CJ == Good Skin Skin: Good Skin Please can anyone help me or get me example ?
Resto Posted August 24, 2015 Author Posted August 24, 2015 lol chinese.explain what you want local 70 = Good Skin local 71 = Nice Skin i want when i have skin ID 70 or 71 there will not Skin: 70 & 71 but Skin: Good Skin
KariiiM Posted August 24, 2015 Posted August 24, 2015 local 70 = Good Skin local 71 = Nice Skin i want when i have skin ID 70 or 71 there will not Skin: 70 & 71 but Skin: Good Skin Do you know, your words are not clear? Are you trying to make for each skin id a custom name in the gridlist with these names , Good skin / Nice skin..?
t3wz Posted August 24, 2015 Posted August 24, 2015 If i understood you correctly you can use a table with skin ids as indexes names = { -- [sKINID] = "NAME", [1] = "skin name 1", [25] = "other name..", [23] = "dsasdsadad" } ... and to retrieve the 'skin name' you just use names[getElementModel(player)]
KariiiM Posted August 24, 2015 Posted August 24, 2015 (edited) Use pairs in this situation Edited August 25, 2015 by Guest
Resto Posted August 24, 2015 Author Posted August 24, 2015 If i understood you correctly you can use a table with skin ids as indexes names = { -- [sKINID] = "NAME", [1] = "skin name 1", [25] = "other name..", [23] = "dsasdsadad" } ... and to retrieve the 'skin name' you just use names[getElementModel(player)] thanks work.
Resto Posted August 24, 2015 Author Posted August 24, 2015 and what i must use when i want to weapons? if ( getPedWeapon ( player ) ) then guiSetText ( aTab1.Weapon, "Weapon: "..getWeaponNameFromID ( getPedWeapon ( player ) ).." (ID: "..getPedWeapon ( player )..")" ) end
KariiiM Posted August 25, 2015 Posted August 25, 2015 and what i must use when i want to weapons? To use weapons? To get weapons names? or what
Resto Posted August 25, 2015 Author Posted August 25, 2015 and what i must use when i want to weapons? To use weapons? To get weapons names? or what 2.
KariiiM Posted August 25, 2015 Posted August 25, 2015 getWeaponNameFromID -- This function is for getting player weapons ID. giveWeapon -- This is for giving player weapon Try by yourself, if you failed then post the code and explain the problem more clear than before, you can learn from your fails
Resto Posted August 25, 2015 Author Posted August 25, 2015 getWeaponNameFromID -- This function is for getting player weapons ID. giveWeapon -- This is for giving player weapon Try by yourself, if you failed then post the code and explain the problem more clear than before, you can learn from your fails i mean: names = { [31] = "1", [29] = "2", [28] = "3" }
t3wz Posted August 25, 2015 Posted August 25, 2015 Use my other post as example, you have to create another table (with other name, obviously) and with it you can use the same 'method' to get weapon's name.
Resto Posted August 25, 2015 Author Posted August 25, 2015 Use my other post as example, you have to create another table (with other name, obviously) and with it you can use the same 'method' to get weapon's name. but i want to weapons not skins.
t3wz Posted August 25, 2015 Posted August 25, 2015 but i want to weapons not skins. really? a table can be used to any thing, not only for skins. othertable = { [24] = "Eagle", [26] = "sawn" } take a look at this (tables section).
Resto Posted August 25, 2015 Author Posted August 25, 2015 but i want to weapons not skins. really? a table can be used to any thing, not only for skins. othertable = { [24] = "Eagle", [26] = "sawn" } take a look at this (tables section). and where i must use "othertable" ? othertable[] ?
t3wz Posted August 25, 2015 Posted August 25, 2015 and where i must use "othertable" ? othertable[] ? Nope, you have to pass an value inside the brackets (in this case the weapon id). othertable[ getPedWeapon(player) ]
Resto Posted August 25, 2015 Author Posted August 25, 2015 and where i must use "othertable" ? othertable[] ? Nope, you have to pass an value inside the brackets (in this case the weapon id). othertable[ getPedWeapon(player) ] thanks work.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now