CreatePed: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser28 (talk | contribs) (Server and Client Side Syntax) |
m (→Example: making it working the way it should) |
||
Line 44: | Line 44: | ||
createPed ( 120, 5540.6654, 1020.55122, 1240.545 ) | createPed ( 120, 5540.6654, 1020.55122, 1240.545 ) | ||
end | end | ||
addEventHandler ( "onResourceStart", | addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 09:45, 13 November 2011
This article needs checking. | |
Reason(s): Please check if I'm right with the bSynced argument. I've been testing two different peds and discovered the effect written below --Sniper 03:12, 4 September 2011 (CEST) |
Creates a Ped in the GTA world.
Syntax
Click to collapse [-]
Serverped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool bSynced = true ] )
Required Arguments
- modelid: A whole integer specifying the GTASA skin ID.
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- rot: A floating point number representing the rotation in degrees.
- bSynced: A boolean value representing whether or not the ped will be fully synchronized even for players that are not within the syncing range. If disabled a player that is more than 100 units away from the ped won't receive any new information about its state and position. This will cause a desync of the ped (useful for frozen/static peds to increase the server perfomance).
Click to collapse [-]
Clientped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )
Required Arguments
- modelid: A whole integer specifying the GTASA skin ID.
- x: A floating point number representing the X coordinate on the map.
- y: A floating point number representing the Y coordinate on the map.
- z: A floating point number representing the Z coordinate on the map.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- rot: A floating point number representing the rotation in degrees.
Returns
Returns a ped element if it was successfully created.
Example
Click to collapse [-]
ServerThis example creates an ped when the resource starts:
function pedLoad ( name ) createPed ( 120, 5540.6654, 1020.55122, 1240.545 ) end addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad )
See Also
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle