I've been learning the MP scripting for a while....
And I've got some problems :
NOTE : Ignore errors in the scripts(such as missing semicolons).
All scripts are just examples.
Problem 1 :============
In my zombie script ,
If (isServer) then
{
zombie setBehaviour "SAFE";
zombie setSpeedMode "LIMITED";
_selectedSound = ZSounds select (random (count ZSounds) - 0.5));
zombie say _selectedSound;
};
And as you can see, the sounds will not be played, because the SAY command is local.
How do I make it so that all players (clients) hear the sound in this situation?
Problem 2 :==============
zombie_init.sqf
------------------
if (isServer) then
{
Hz_Shoot = TRUE;
Hz_Flee = TRUE;
};
shoot.sqf
-----------
if (not (IsServer)) exitWith {};
while {alive vicim} do
{
if (Hz_Shoot) then
{
victim dofire zombie;
}else
{
sleep 1;
};
};
As you can see, both zombie_init.sqf and shoot.sqf are only running on the server.
Question : Do i need to use PublicVariable for the variables,Hz_Shoot and Hz_Flee?
Problem 3 :================
Question : How do i run a script for all clients from a scope that is only running for the server?
For example :
if (isServer) then
{
nil = [] execVM "script.sqf";
};
What I want to do is, script.sqf to be executed on ALL machines.
-------------------------------------------------------------------------------
Other questions :
Where can i find which eventhandler is local and which is global?
Regards,
haroon1992