Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
Feress

Автобилдинг строения при спавне

Привет всем!
Пытался сделать спавн флагштока на сервере чтобы он забилдился сам, но никак не получается сделать. Раскопал все скрипты дейза, но так и ничего не получилось.
Возможно, кто подскажет 😁

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
	vector flagPos = oPlayer.GetPosition() + "5 0 5";
	flagPos[1] = GetGame().SurfaceY(flagPos[0],flagPos[2]);
	vector flagOrient = GetGame().GetSurfaceOrientation(flagPos[0],flagPos[2]);
	TerritoryFlag totem = TerritoryFlag.Cast( GetGame().CreateObjectEx( "TerritoryFlag", flagPos, ECE_PLACE_ON_SURFACE ) );
	totem.SetPosition( flagPos );
	totem.SetOrientation( flagOrient );
	totem.OnDebugSpawn();
	totem.SetSynchDirty();
	totem.UpdateVisuals();

 

Share this post


Link to post
Share on other sites



  • 0

Спасибо, добрейший тебе человек. Заспавнился. Но работает это только если хотя бы 1 игрок на сервере, причем не важно где. 
Немного переделал и вот:
В main():
GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(SpawnFlag, 1000, true);

Где то в другом месте:
void SpawnFlag()
{
    ref array<Man> players = new array<Man>;
    GetGame().GetPlayers( players );
    if(players.Count() >= 1){
        vector flagPos = "11525.962891 69.510117 6598.496582";
        flagPos[1] = GetGame().SurfaceY(flagPos[0],flagPos[2]);
        vector flagOrient = GetGame().GetSurfaceOrientation(flagPos[0],flagPos[2]);
        HWDM_CaptureFlag = TerritoryFlag.Cast( GetGame().CreateObjectEx( "TerritoryFlag", flagPos, ECE_PLACE_ON_SURFACE ) );
        HWDM_CaptureFlag.SetPosition( flagPos );
        HWDM_CaptureFlag.SetOrientation( flagOrient );
        HWDM_CaptureFlag.OnDebugSpawn();
        HWDM_CaptureFlag.SetSynchDirty();
        HWDM_CaptureFlag.UpdateVisuals();
        GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Remove(SpawnFlag)
    }
}

Edited by Feress (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.