Jump to content
  • 0

R > Freeze Command Script


Question

Posted

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!

9 answers to this question

Recommended Posts

  • 0
Posted

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);
}

 

  • 0
Posted
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.

  • 0
Posted
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?

  • 0
Posted
-	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);
}

 

  • 0
Posted
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

  • 0
Posted (edited)
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
  • 0
Posted
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?

  • 0
Posted
-	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
  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...