Jump to content

Recommended Posts

Hey folks,

I'm a noob when it comes to scripting so please excuse my ignorance.

To my understanding typetext & typetext2 are global events. The reason why I ask is because I want to be able to play out text to a player's client when they respawn in but not to the other clients on the server at the same time. Let me elaborate.

 

Example:
Player One dies in the field then respawns. Once he spawns only he sees the typetext2 notifying him of his location, but the other members of his squad out in the field don't see the typetext2 Player One sees.

 

The idea is I want to avoid spamming players with type text each time a player is killed and respawns.

 

Right now this is what I have in my OnPlayerRespawn.sqf

 

//Loadout Previous kit saved from OnPlayerKilled.sqf
removeAllWeapons player; 
removeGoggles player; 
removeHeadgear player; 
removeVest player; 
removeUniform player; 
removeAllAssignedItems player; 
clearAllItemsFromBackpack player; 
removeBackpack player; 
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);
//
[
 [
  ["TAVANAKA AIRBASE,","align = 'center' = '1' size = '0.7' font='PuristaBold'"],
  ["TANOA","align = 'center' = '1' size = '0.7'","#aaaaaa"],
  ["","<br/>"],
  ["CHARLIE COMPANY OPERATIONS CENTER","align = 'center' = '1' size = '1.0'"]
 ]
] spawn BIS_fnc_typeText2;

This works well and good but inevitably causes the aforementioned spamming when multiple players need to respawn.

I looked at other work arounds like delaying the text from triggering again after say 300 seconds but I'm not entirely sure how to implement that, again I'm a bit of a noob but slowly learning. I hope I made my case clear and look forward to any guidance you guys can offer. Thanks!

Share this post


Link to post
Share on other sites
1 hour ago, Hybrid V said:

This works well and good but inevitably causes the aforementioned spamming when multiple players need to respawn.

It shouldn't do. There is nothing in either function or any of its child functions that would cause the text to happen globally, and onPlayerRespawn.sqf is only called locally for the player that respawns.

Share this post


Link to post
Share on other sites

Ok good to know! I was told otherwise on another forum but I'm glad I asked here for a second opinion.

Share this post


Link to post
Share on other sites
37 minutes ago, Hybrid V said:

Ok good to know! I was told otherwise on another forum but I'm glad I asked here for a second opinion.

if you want to know if something will happen locally(one client that it runs on) or globally(all clients), look here on the wiki page. here it shows local, some show local or global thought so for those look at the parameters.

 

304e36a07402941c84bca8918fd39fbc.png

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

×