Comments (11)
I've test this, and everything looks good:
public FCNPC_OnInit()
{
npcs[0] = FCNPC_Create("test1");
FCNPC_Spawn(npcs[0], 1, 85.2381, -232.6194, 1.5781);
foreach (new npcid : FCNPC) {
FCNPC_SetVelocity(npcid, 0.1, 0.1, 0.2, true);
}
SetTimer("timer", 1000, 1);
return 1;
}
forward timer();
public timer()
{
foreach (new npcid : FCNPC) {
new Float:x, Float:y, Float:z;
FCNPC_GetPosition(npcid, x, y, z);
printf("npc %d: %.2f, %.2f, %.2f", npcid, x, y, z);
}
}
npc 999: 89.03, -228.81, 9.17
npc 999: 92.73, -225.11, 16.57
npc 999: 96.53, -221.31, 24.17
npc 999: 100.33, -217.51, 31.77
npc 999: 104.13, -213.71, 39.37
npc 999: 107.93, -209.91, 46.97
from fcnpc.
Set a position that throws the NPC into the air or raises them into the air and they will return to their previous position
from fcnpc.
Show me your code and video.
from fcnpc.
error 017: undefined symbol "FCNPC_InitMapAndreas"
from fcnpc.
CMD:bt(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
npppcid = FCNPC_Create("BOT");
FCNPC_Spawn(npppcid, 100, x, y, z);
SetTimer("timerdebug", 1000, 1);
return 1;
}
CMD:btvelo(playerod, params[])
{
new Float:X, Float:Y, Float:Z;
FCNPC_GetVelocity(npppcid, Float:X, Float:Y, Float:Z);
/* repeat pos infinite */
FCNPC_SetVelocity(npppcid, Float:X, Float:Y, Float:Z + 0.00050, true);
return 1;
}
/* NPC bug doesn't fall in the air */
CMD:btstop(playerod, params[])
return FCNPC_SetVelocity(npppcid, Float:0.0, Float:0.0, Float:0.0, true);
Logs
npc 99: 2734.02, 1252.56, 106.53
npc 99: 2734.02, 1252.56, 106.53
npc 99: 2734.02, 1252.56, 106.53
npc 99: 2734.02, 1252.56, 106.53
npc 99: 2734.02, 1252.56, 106.53
npc 99: 2734.02, 1252.56, 106.53
[CMD] [HashHatake]: /btvelo
npc 99: 2734.02, 1252.56, 106.55
npc 99: 2734.02, 1252.56, 106.62
npc 99: 2734.02, 1252.56, 106.68
npc 99: 2734.02, 1252.56, 106.75
npc 99: 2734.02, 1252.56, 106.81
npc 99: 2734.02, 1252.56, 106.87
npc 99: 2734.02, 1252.56, 106.94
npc 99: 2734.02, 1252.56, 107.01
npc 99: 2734.02, 1252.56, 107.08
npc 99: 2734.02, 1252.56, 107.15
npc 99: 2734.02, 1252.56, 107.22
npc 99: 2734.02, 1252.56, 107.29
npc 99: 2734.02, 1252.56, 107.36
npc 99: 2734.02, 1252.56, 107.43
Inpc 99: 2734.02, 1252.56, 107.49
npc 99: 2734.02, 1252.56, 107.56
npc 99: 2734.02, 1252.56, 107.63
npc 99: 2734.02, 1252.56, 107.70
npc 99: 2734.02, 1252.56, 107.76
npc 99: 2734.02, 1252.56, 107.82
[CMD] [HashHatake]: /btstop
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
npc 99: 2734.02, 1252.56, 107.89
https://www.youtube.com/watch?v=2rld0zMkRqU
from fcnpc.
I can see the position changing, but slowly.
from fcnpc.
https://www.youtube.com/watch?v=UuhjiW-PsJ4
#include <a_samp>
#include "foreach"
#include "FCNPC"
new npcs[2];
main() {
}
public OnGameModeInit() {
AddPlayerClass(1, 85.0, -232.0, 1.6, 0.0, 31, 999, 0, 0, 0, 0);
return 1;
}
public FCNPC_OnInit()
{
npcs[0] = FCNPC_Create("test1");
FCNPC_Spawn(npcs[0], 1, 85.2381, -232.6194, 1.5781);
npcs[1] = FCNPC_Create("test2");
FCNPC_Spawn(npcs[1], 1, 84.2381, -231.6194, 1.5781);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/velocity", true) == 0) {
foreach (new npcid : FCNPC) {
FCNPC_SetVelocity(npcid, 0, 0, 0.02, true);
}
return 1;
}
return 0;
}
from fcnpc.
Up they go well, the problem is making them fall to the ground
from fcnpc.
Set negative velocity and reset to 0 when they reach ground
from fcnpc.
Set negative speed and reset to 0 when they hit the ground
How to detect soil?
from fcnpc.
You can use MapAndreas or ColAndreas
from fcnpc.
Related Issues (20)
- Need Some Information About Some Natives HOT 3
- Correct Delta Calculations
- Signal 11 (Segmentation fault), address is 351 from f79570e3 HOT 2
- Signal 11 (Segmentation fault) HOT 2
- FCNPCs can't drive trailers
- The position of the train cars is not returned if FCNPC drive train.
- FCNPC_EnterVehicle. NPC should not check map.
- FCNPC_LoadPlayingPlayback conflicts with temporary recordings loaded by FCNPC_StartPlayingPlayback
- FCNPC Not created HOT 1
- FCNPC CRASH HOT 7
- FCNPC CRASH AFTER GMX HOT 9
- FCNPC Crash HOT 4
- Crash issue HOT 3
- Bug HOT 3
- Crash while server executing HOT 14
- NPC leaves the server directly after spawning. HOT 3
- Server is not starting HOT 11
- Server crashes randomly (FCNPC 2.0.9, SA:MP 0.3.7 R2, Ubuntu 22.04). HOT 1
- Callbacks not being called on filterscripts HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fcnpc.