fixed from along time in linux you should use full plugin name with .so
thanks
thanks
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: MEGAMIND on Apr 09, 2025, 02:04 PMQuote from: PLAYER on Apr 09, 2025, 01:55 PMI used the Same Structure You Gave me:-make sure these are linux plugins not the win architecture, also make sure the plugins are in right path
ConnectNPCEx("Bot", Vector(-1375.21, -664.22, 14.1484), 90.0, 1, 26, 255, "shoot.nut", true, "127.0.0.1", "rpclib actionlib");
But its still showing error
Failed loading plugin: rpclib
Failed loading plugin: actionlib
Loaded 0 pluginsnpcscripts/plugins
function GiveAmmoToWeapon(player, weapon, amount)
{
local currentwep = player.Weapon;
local currentammo = player.GetAmmoAtSlot(player.Slot);
local weapon = weapon;
amount = amount;
player.GiveWeapon(weapon,amount);
if (currentwep != weapon ) player.SetWeapon(currentwep,currentammo);
}
Quote from: habi2 on Feb 05, 2025, 03:53 PMalright, thank youQuote from: [TDA]Speed on Feb 04, 2025, 04:42 PMHello hapi, i wonder if you will add something like Npc.Walkto and Npc.Run like normal player walking and running because walktopoint is walking without anim and not so perefct i hope you added these twoI understand you want npc.walkto( position ) and npc.run( ) like normal player walking and running. It would be great to have it pre-built.
i will check if anything can be done about this issue.
target<-null;timerid<-null;
WALK_START <- Vector(-872.146, -431.502, 11.5288);
WALK_END <- Vector( -870.825, -296.79, 11.173);
walking <- false;
reached <- false;
function WalkToPoint(point)
{
target=point;
if(timerid==null)
{
timerid=SetTimerEx("step_forward",100,0);
//Remotely calling functions 'compilestring' of server.
RFC(F("compilestring")("function SetWalkingAnimation(id){ local p=FindPlayer(id); if(p && IsPlayerNPC(id))p.SetAnim(0,0);else WalkTimer"+GetMyID()+".Delete()}"))();
RFC(F("compilestring")("WalkTimer"+GetMyID()+"<-NewTimer(\"SetWalkingAnimation\",100,0,"+GetMyID()+")"))();
}
}
function Walk(pos)
{
walking = true;
target = pos;
local lastpos= GetMyPos();
local newpos= pos;
local z=FindZFor2DCoord(newpos.x, newpos.y);
if(!z)
{
Stop();
return;
}
else newpos.z=z+ 0.5; //Update z co-ordinate so that npc do not float in air/fall down.
//Check wall, etc.
if(newpos.z-lastpos.z > 0.5)
{
//cannot move forward
Stop();
SendChat("I can't go further");
print("the jump is "+(newpos.z-lastpos.z)+" to "+newpos+" from "+lastpos+"\n");
return
}
//step_forward()
SetLocalValue(F_ANGLE, atan2(-(target.x - GetMyPosX()), target.y - GetMyPosY()));
//SetLocalValue(F_POSX,newpos.x);
//SetLocalValue(F_POSY,newpos.y);
//SetLocalValue(F_POSZ,newpos.z);
SetLocalValue(I_KEYS, KEY_ONFOOT_FORWARD)
SetLocalValue(V_ONFOOT_SPEED, (newpos-lastpos).Normalised()*0.12688)
move2(lastpos,GetMyFacingAngle(), 0.22,0)
SendOnFootSyncDataLV()
//if( GetDistanceFromMeToPoint( target ) < 1 )
//{
//SetMyPos(target);
//Stop();
//}
}
function Stop()
{
if(timerid!=null)
KillTimer(timerid)
//Send stationary-npc packet (stop walking)
SetLocalValue(I_KEYS, 0)
SetLocalValue(V_ONFOOT_SPEED, Vector(0,0,0))
SendOnFootSyncDataLV()
walking = false;
}
function onDestinationReached()
{
if( GetDistanceFromMeToPoint( WALK_START ) < 2 )
WalkToPoint( WALK_END );
else if( GetDistanceFromMeToPoint( WALK_END ) < 2 )
{
WalkToPoint( WALK_START );
//print something on server console.
RFC("print")("npc: i completed one round of patrol");
}
}
function step_forward()
{
local newpos=GetMyPos()+(target-GetMyPos()).Normalised()*0.14;
newpos.z=FindZFor2DCoord(newpos.x, newpos.y)+1.0425;
//SetLocalValue(V_POS, newpos);
SetLocalValue(F_ANGLE, atan2(-(target.x-GetMyPosX()),target.y-GetMyPosY()));
//if((target-GetMyPos()).Length()<0.8)//reached destination
////{
//if(timerid!=null)
// KillTimer(timerid);
//timerid=null;
//stop timer of server
//RFC(F("compilestring")("WalkTimer"+GetMyName()+".Delete()"))();
//}
//else SendOnFootSyncDataLV();
//if(timerid==null)
//onDestinationReached();
}
function OnNPCSpawn()
{
//SetTimerEx("SetMyPos",700, 1, WALK_START );
// SetMyPos(WALK_START);
//print(GetMyPos());
//SetTimerEx("Walk", 1000, 1 );
//WalkToPoint( WALK_END );
//Acquire weapon and skin
RFC(F("compilestring")("FindPlayer("+GetMyID()+").SetWeapon(4,1);"))();
RFC(F("compilestring")("FindPlayer("+GetMyID()+").Skin=1"))();
//SetTimerEx("SetLocalValue", 1000,1, I_CURWEP, 4);
//if( GetDistanceFromMeToPoint( pos ) < 2 ) WalkToPoint( pos );
SetTimerEx("checktowalk", 1000, 0 );
}
function checktowalk()
{
local msg;
local name;
local pos;
local Distance;
local x;
local num_streamed_in = 0;
local num_connected = 0;
x=0;
while(x!=MAX_PLAYERS) {
if(IsPlayerConnected(x)) {
num_connected++;
if(IsPlayerStreamedIn(x)) {
num_streamed_in++;
name=GetPlayerName(x);
pos=GetPlayerPos(x);
Distance=GetDistanceFromMeToPoint(pos);
if (Distance < 30) if (walking == false && reached == false) Walk(pos);
if (Distance > 35) Stop();
//if (Distance < 1)
//{
//SetMyPos(x.pos);
//walking = false;
//reached == true;
//}
if (Distance > 2 && reached == true)
{
walking = false;
reached == false;
}
if(GetPlayerState(x) == PLAYER_STATE_DRIVER) {
msg=format("I see %s driving vehicle: %d",name,GetPlayerVehicleID(x));
SendChat(msg);
}
}
}
x++;
};
}
function OnNPCScriptLoad(params)
{
if(!MiamiScale_Init("default.map"))
{
SendChat("My map is not loaded. Bye");
QuitServer();
}
}
function OnNPCScriptUnload()
{
MiamiScale_Unload();
}
Quote from: MEGAMIND on Feb 04, 2025, 05:06 PMnot perfect you can see sometimes will sure missed because timers and anims i meant like normal npcs walk exmple in offline game walking smoothlyQuote from: [TDA]Speed on Feb 04, 2025, 04:42 PMHello hapi, i wonder if you will something like Npc.Walkto and Npc.Run like normal player walking and running because walktopoint is walking without anim and not so perefct i hope you added these twou can set anim on walk amd timers.. theres example in npc wiki, same goes for running