You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localcurrentTexture, currentModel=getPedClothes ( thePlayer, clothesType ) -- get the current clothes on this slot
3
-
localclothesIndex=-1
4
-
if ( currentTexture ) then-- if he had clothes of that type
5
-
localtempA, tempB=getTypeIndexFromClothes ( currentTexture, currentModel ) -- get the type and index for these clothes, so we can increase it to get the next set in the list
localcurrentTexture, currentModel=getPedClothes(thePlayer, clothesType) -- get the current clothes on this slot
3
+
localclothesIndex=-1
4
+
if (currentTexture) then-- if he had clothes of that type
5
+
localtempA, tempB=getTypeIndexFromClothes(currentTexture, currentModel) -- get the type and index for these clothes, so we can increase it to get the next set in the list
6
+
if (tempAandtempB) then-- if we found them
7
+
clothesType, clothesIndex=tempA, tempB
8
+
end
9
+
end
10
+
clothesIndex=clothesIndex+1
11
+
localtexture, model=getClothesByTypeIndex(clothesType, clothesIndex) -- get the new texture and model
12
+
if (nottexture) then-- if we've reached the end of the list
localcurrentTexture, currentModel=getPedClothes ( thePlayer, clothesType ) -- get the current clothes on this slot
3
-
localclothesIndex=1
4
-
if ( currentTexture ) then-- if he had clothes of that type
5
-
localtempA, tempB=getTypeIndexFromClothes ( currentTexture, currentModel ) -- get the type and index for these clothes, so we can decrease and get the previous in the list
localcurrentTexture, currentModel=getPedClothes(thePlayer, clothesType) -- get the current clothes on this slot
3
+
localclothesIndex=1
4
+
if (currentTexture) then-- if he had clothes of that type
5
+
localtempA, tempB=getTypeIndexFromClothes(currentTexture, currentModel) -- get the type and index for these clothes, so we can decrease and get the previous in the list
6
+
if (tempAandtempB) then-- if we found them
7
+
clothesType, clothesIndex=tempA, tempB
8
+
end
9
+
end
10
+
clothesIndex=clothesIndex-1
11
+
localtexture, model=getClothesByTypeIndex(clothesType, clothesIndex) -- get the new texture and model
12
+
if (nottexture) then-- if we've reached the end of the list
description: 'This function is used to get the texture and model of clothes by the
5
-
clothes type and index.
6
-
7
-
(Scans through the list of clothes for the specific type).'
3
+
description: This function is used to get the texture and model of clothes by the clothes type and index. (Scans through the list of clothes for the specific type).
8
4
parameters:
9
5
- name: clothesType
10
6
type: int
11
7
description: An integer representing the clothes slot/type to scan through.
8
+
templateList: clothingTypes
12
9
- name: clothesIndex
13
10
type: int
14
-
description: MISSING_PARAM_DESC
15
-
examples:
16
-
- path: examples/getClothesByTypeIndex-1.lua
17
-
description: This example gets the current clothes of a certain type on a player,
18
-
then swaps with the next in the clothes list.
19
-
side: server
11
+
description: An integer representing the index (0 based) set of clothes in the list you wish to retrieve. Each type has a different number of valid indexes.
20
12
returns:
21
13
values:
22
-
- type: string string
23
-
name: value
24
-
description: This function returns 2 strings, a texture and model respectively,
25
-
false if invalid arguments were passed to the function.
26
-
requires_review: true
14
+
- type: string
15
+
name: texture
16
+
- type: string
17
+
name: model
18
+
description: This function returns 2 strings, a texture and model respectively, false if invalid arguments were passed to the function.
19
+
20
+
server:
21
+
<<: *shared
22
+
examples:
23
+
- path: examples/getClothesByTypeIndex-1.lua
24
+
description: This example gets the current clothes of a certain type on a player, then swaps with the next in the clothes list.
description: 'This function is used to get the clothes type and index from the texture
5
-
and model.
6
-
7
-
(Scans through the list of clothes for the specific type).'
3
+
description: This function is used to get the clothes type and index from the texture and model. (Scans through the list of clothes for the specific type).
8
4
parameters:
9
5
- name: clothesTexture
10
6
type: string
11
-
description: A string determining the clothes texture that you wish to retrieve
12
-
the type and index from. See the clothes catalog .
7
+
description: A string determining the clothes texture that you wish to retrieve the type and index from. See the [clothes catalog](/reference/ID_Lists/CJ_Clothes).
13
8
- name: clothesModel
14
9
type: string
15
-
description: A string determining the corresponding clothes model that you wish
16
-
to retrieve the type and index from. See the clothes catalog .
17
-
examples:
18
-
- path: examples/getTypeIndexFromClothes-1.lua
19
-
description: This example gets the current clothes of a certain type on a player,
20
-
then swaps with the previous in the clothes list.
21
-
side: server
10
+
description: A string determining the corresponding clothes model that you wish to retrieve the type and index from. See the [clothes catalog](/reference/ID_Lists/CJ_Clothes).
22
11
returns:
23
12
values:
24
-
- type: int int
25
-
name: value
26
-
description: This function returns two integers, type and index respectively,
27
-
false if invalid arguments were passed to the function.
28
-
requires_review: true
13
+
- type: int
14
+
name: type
15
+
- type: int
16
+
name: index
17
+
description: This function returns two integers, type and index respectively, false if invalid arguments were passed to the function.
18
+
19
+
server:
20
+
<<: *shared
21
+
examples:
22
+
- path: examples/getTypeIndexFromClothes-1.lua
23
+
description: This example gets the current clothes of a certain type on a player, then swaps with the previous in the clothes list.
0 commit comments