HU/addPedClothes: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{Shared function hu}}
{{Shared function hu}}
{{Note|This function only works with peds using CJ skin (ID 0).}}
{{Note|Ez a function egyedül csak a CJ skinnel működik (ID 0).}}
This function is used to set the current clothes on a [[ped]].  
This function is used to set the current clothes on a [[ped]].  


Line 11: Line 11:


===Kötelező paraméterek===
===Kötelező paraméterek===
*'''thePed''': The [[ped]] whose clothes you want to change.
*'''thePed''': A [[ped]], akinek a ruháját meg akarjuk változtatni.
*'''clothesTexture''': A string determining the clothes texture that will be added. See the [[CJ Clothes|clothes catalog]].
*'''clothesTexture''': A string determining the clothes texture that will be added. See the [[CJ Clothes|clothes catalog]].
*'''clothesModel''': A string determining the clothes model that will be added. See the [[CJ Clothes|clothes catalog]].
*'''clothesModel''': A string determining the clothes model that will be added. See the [[CJ Clothes|clothes catalog]].
Line 17: Line 17:


===Visszatérési érték===
===Visszatérési érték===
This function returns ''true'' if the clothes were successfully added to the ped, ''false'' otherwise.
Visszatérési értéke ''true'', ha a ruhák sikeresen hozzá lettek adva a pedhez, egyébként ''false''.


==Példa==
==Példa==
<section name="Server" class="server" show="true">
<section name="Server" class="server" show="true">
This example adds a 'moto' helmet to a player when he gets on a nrg bike, and removes it when he gets off.
Ez a példa egy 'moto' sisakot rak egy játékosra, amikor egy nrg-ra ül fel, majd eltávolítja, ha leszáll róla.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function onEnterVehicle ( theVehicle, seat, jacked )
function onEnterVehicle ( theVehicle, seat, jacked )
Line 41: Line 41:
==Lásd még==
==Lásd még==
{{Ped functions}}
{{Ped functions}}
==Fordította==
* '''''[https://wiki.multitheftauto.com/wiki/User:Surge Surge]'''''


[[en:AddPedClothes]]
[[en:AddPedClothes]]
[[pl:AddPedClothes]]
[[pl:AddPedClothes]]

Revision as of 21:37, 17 September 2018

[[{{{image}}}|link=|]] Note: Ez a function egyedül csak a CJ skinnel működik (ID 0).

This function is used to set the current clothes on a ped.

Szintaxis

bool addPedClothes ( ped thePed, string clothesTexture, string clothesModel, int clothesType )

OOP Syntax Help! I don't understand this!

Method: ped:addClothes(...)
Counterpart: getPedClothes


Kötelező paraméterek

  • thePed: A ped, akinek a ruháját meg akarjuk változtatni.
  • clothesTexture: A string determining the clothes texture that will be added. See the clothes catalog.
  • clothesModel: A string determining the clothes model that will be added. See the clothes catalog.
  • clothesType: A integer representing the clothes slot/type the clothes should be added to. See the clothes catalog.

Visszatérési érték

Visszatérési értéke true, ha a ruhák sikeresen hozzá lettek adva a pedhez, egyébként false.

Példa

Click to collapse [-]
Server

Ez a példa egy 'moto' sisakot rak egy játékosra, amikor egy nrg-ra ül fel, majd eltávolítja, ha leszáll róla.

function onEnterVehicle ( theVehicle, seat, jacked )
    if getElementModel ( theVehicle ) == 522 then         -- if it's an nrg
        addPedClothes ( source, "moto", "moto", 16 )   -- add the helmet
    end
end
addEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle )

function onExitVehicle ( theVehicle, seat, jacked )
    if getElementModel ( theVehicle ) == 522 then      -- if it's an nrg
        removePedClothes ( source, 16 )              -- remove the helmet
    end
end
addEventHandler ( "onPlayerVehicleExit", root, onExitVehicle )

Lásd még

Shared



Fordította