SendOnFootSyncData: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Welcome|
{{Welcome|
desc=This will send a packet to server which is filled by the following parameters.|
desc=This will send a on foot sync packet to server which is filled by the following parameters.|
params=<syntaxhighlight lang="lua">(keys, posX, posY, posZ, angle, health, armour, weapon, speedX, speedY, speedZ, aimPosX, aimPosY, aimPosZ, aimDirX, aimDirY, aimDirZ)</syntaxhighlight>
params=<syntaxhighlight lang="lua">( keys, posx, posy, posz, angle, health, armour, weapon, ammo, speedx, speedy, speedz, aimposx, aimposy, aimposz, aimdirx, aimdiry, aimdirz, isCrouching, isReloading )</syntaxhighlight>
<poem>::keys [integer] : The players Game Keys to hold.
<poem>::keys : The npc's Game Keys to hold.
::posX [float] : The npc's position x co-ordinate.
::posx : The npc's position x co-ordinate.
::posY [float] : The npc's position y co-ordinate.
::posy  : The npc's position y co-ordinate.
::posZ [float] : The npc's position z co-ordinate.
::posz  : The npc's position z co-ordinate.
::angle [float] : The npc's facing angle in radians.(-PI to PI ).
::angle : The npc's facing angle in radians.(-PI to PI ).
::health [integer] : Health of the npc.  
::health : Health of the npc.  
::armour [integer] : Armour of the npc.
::armour : Armour of the npc.
::weapon [integer] : Weapon of the npc.
::weapon : Weapon of the npc.
::speedX [float] : The npc's speed in x direction (supposed to be same as player.Speed.x on serverside )
::ammo : The amount of ammo the npc has for weapon.
::speedY [float] : The npc's speed in y direction ( " )
::speedx : The npc's speed in x direction (supposed to be same as player.Speed.x on serverside )
::speedZ [float] : The npc's speed in z direction ( " )
::speedy : The npc's speed in y direction ( " )
::aimPosX [float] : The x co-ordinate of aim position of NPC ( can be determined using server using player.AimPos or can be calculated artificially).
::speedz : The npc's speed in z direction ( " )
::aimPosY [float] : The y co-ordinate of aim position of NPC
::aimposx : The x co-ordinate of aim position of NPC ( can be determined using server using player.AimPos or can be calculated artificially).
::aimPosZ [float] : The z co-ordinate of aim position of NPC
::aimposy : The y co-ordinate of aim position of NPC
::aimDirX [float] : The x value given by player.AimDir. (It is mostly 0 or PI )
::aimposz : The z co-ordinate of aim position of NPC
::aimDirY [float] : The y value given by player.AimDir.
::aimdirx : The x value given by player.Aimdir. (It is mostly 0 or PI )
::aimDirZ [float] : The z value given by player.AimDir. (usually ranges from -PI/2 to PI/2)
::aimdiry : The y value given by player.Aimdir.
::aimdirz : The z value given by player.Aimdir. (usually ranges from -PI/2 to PI/2)
::isCrouching : Whether the player is crouching. ( need not set to true even if aiming using weapons like ruger or sniper rifles. The logic is whether player has previously send 'Crouch Key'.)
::isReloading: true, if the player has stopped shooting and is reloading his weapon. false, otherwise. The keys while reloading when 'Bitwise AND' with 512 must be zero while reloading. If the keys given are otherwise, the corresponding bit will be set off to match this requirement.
</poem>|
</poem>|
note=This was added in v2.0 and will not work in previous builds.|
example=
<poem>
::Please see [[Attack Script]] for working examples of shooting players/objects.
</poem>|
note=This was added in v1.4 and will not work in previous builds.|
relfuncs=*[[SendOnFootSyncDataEx]]
*[[SendOnFootSyncDataLV]]|
}}
}}

Latest revision as of 03:55, 20 February 2023


Description:
This will send a on foot sync packet to server which is filled by the following parameters.


Parameters:

( keys, posx, posy, posz, angle, health, armour, weapon, ammo, speedx, speedy, speedz, aimposx, aimposy, aimposz, aimdirx, aimdiry, aimdirz, isCrouching, isReloading )

keys : The npc's Game Keys to hold.
posx : The npc's position x co-ordinate.
posy  : The npc's position y co-ordinate.
posz  : The npc's position z co-ordinate.
angle : The npc's facing angle in radians.(-PI to PI ).
health : Health of the npc.
armour : Armour of the npc.
weapon : Weapon of the npc.
ammo : The amount of ammo the npc has for weapon.
speedx : The npc's speed in x direction (supposed to be same as player.Speed.x on serverside )
speedy : The npc's speed in y direction ( " )
speedz : The npc's speed in z direction ( " )
aimposx : The x co-ordinate of aim position of NPC ( can be determined using server using player.AimPos or can be calculated artificially).
aimposy : The y co-ordinate of aim position of NPC
aimposz : The z co-ordinate of aim position of NPC
aimdirx : The x value given by player.Aimdir. (It is mostly 0 or PI )
aimdiry : The y value given by player.Aimdir.
aimdirz : The z value given by player.Aimdir. (usually ranges from -PI/2 to PI/2)
isCrouching : Whether the player is crouching. ( need not set to true even if aiming using weapons like ruger or sniper rifles. The logic is whether player has previously send 'Crouch Key'.)
isReloading: true, if the player has stopped shooting and is reloading his weapon. false, otherwise. The keys while reloading when 'Bitwise AND' with 512 must be zero while reloading. If the keys given are otherwise, the corresponding bit will be set off to match this requirement.


Return Values:
This function does not return any specific values.

Important Note:
This was added in v1.4 and will not work in previous builds.

Example

Please see Attack Script for working examples of shooting players/objects.

Related Functions

The following functions may be helpful as they relate to this function in one way or another.