Jump to content
  • 0

R > Freeze Command Script


Finale

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

Hi Guys,

 

Requesting for a Freeze Status command wherein if I type @freeze all players inside a specific map will be frozen state and will be unfrozen once I type @unfrozen.

 

Thanks in advance!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

I didn't test it, but this should do what you want.
 

-	script	FREEZE	FAKE_NPC,{
	OnInit:
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze");
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze");
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, getarg(0), .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

1 hour ago, Winterfox said:

I didn't test it, but this should do what you want.
 

-	script	FREEZE	FAKE_NPC,{
	OnInit:
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze");
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze");
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, getarg(0), .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

Hi Thank you! I will test this script.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

1 hour ago, Winterfox said:

I didn't test it, but this should do what you want.
 

-	script	FREEZE	FAKE_NPC,{
	OnInit:
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze");
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze");
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, getarg(0), .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

image.png.757bb7944fff87cbc7b7b94b8828cc00.png

I got this error while running the command.

 

Is it also possible that this command will only be available to group ID 99? and will only work in a specific map?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

-	script	FREEZE	FAKE_NPC,{
	OnInit:
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze");
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze");
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, .@atcmd_parameters$[0], .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

9 minutes ago, Winterfox said:
-	script	FREEZE	FAKE_NPC,{
	OnInit:
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze");
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze");
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, .@atcmd_parameters$[0], .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

The error is gone but I got this new message

 

image.png.7528072955cbcde149523f1642413469.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

2 hours ago, Finale said:

The error is gone but I got this new message

 

image.png.7528072955cbcde149523f1642413469.png

Well, you wanted to be able to give it a map, so you must provide a map as first parameter: @freeze prontera.

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

1 hour ago, Winterfox said:

Well, you wanted to be able to give it a map, so you must provide a map as first parameter: @freeze prontera.

Ohh... I see sorry I didn't understand at first. Its working!

 

Is it possible to only restrict this command to GMs? or group id 99?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   87
  • Joined:  06/30/18
  • Last Seen:  

-	script	FREEZE	FAKE_NPC,{
	OnInit:
		.@group = 99;
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze", .@group);
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze", .@group);
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, .@atcmd_parameters$[0], .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.05
  • Content Count:  37
  • Reputation:   0
  • Joined:  06/09/23
  • Last Seen:  

16 hours ago, Winterfox said:
-	script	FREEZE	FAKE_NPC,{
	OnInit:
		.@group = 99;
		bindatcmd("freeze", strnpcinfo(3) + "::OnFreeze", .@group);
		bindatcmd("unfreeze", strnpcinfo(3) + "::OnUnfreeze", .@group);
	end;
	
	OnFreeze:
		.@mode = 1;
	OnUnfreeze:
		getmapunits(BL_PC, .@atcmd_parameters$[0], .@players);
		freeloop(1);
		for(.@i = 0; .@i < getarraysize(.@players); .@i++)
			pcblockmove(.@players[.@i], .@mode);
		freeloop(0);
}

 

All good now thank you @Winterfox

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...