Jump to content
Sign in to follow this  
MrRightclick

Talk to NPC - send global message to calling player (dedicated server)

Recommended Posts

Hello,

I posted a thread earlier about creating an ammo box and making an NPC give you the closest town through chat or a screen text. The spawning is working all fine and dandy, but the dude saying stuff in global chat doesn't send a message to anyone.

Do I need to make player checks somewhere or something?

The addAction script called on the AI unit init field (everyone in the dedi server gets the action, but it doesn't do anything):

_dude = _this select 0;

_dude addAction ["Talk to friendly unit", "tell_stuff.sqf"];

The chat script:

_host = _this select 0;
_caller = _this select 1;
_id = _this select 2;

//get the placed ammobox
_ammobox = ammo1;

//check if host is alive
if (alive _host) then {
_host globalChat "Hello!";


//get closest town to ammobox
_closesttown = (nearestLocations [_ammobox,["NameCityCapital","NameCity","NameVillage"],10000]) select 0;

_town_name = text _closesttown;
_town_pos = position _closesttown;

Sleep 2.5;
_host globalChat ("We were patrolling the area and saw a broken down enemy weapon shipment.");
Sleep 2.5;
_host globalChat ("It was located near " + str(_town_name));
};

This works in a listen server, but not in a dedicated one. In a listen server only the calling player gets the globalchat, which is awesome. In a dedi server, nobody gets any messages at all.

Help? Thanks! :D

Edited by MrRightclick

Share this post


Link to post
Share on other sites

Bumping this -- basically I'm looking for a way to send a global message to a player calling a script through an addaction in a Dedicated server...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×