Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 78 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoD+UO General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: Need help with admin script for cod uo
Rainbowsix
General Member
Since: Jun 19, 2008
Posts: 56
Last: May 23, 2017
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Saturday, May. 13, 2017 08:17 pm
Hello iam trying to extend the buildt in admin mod in cod uo awe with a player freeze function but i cant get it to work. This is my code


givefreeze()
{
self endon("boot");

setcvar("g_freeze", "");
while(1)
{
if(getcvar("g_freeze") != "")
{
freezePlayerNum = getcvarint("g_freeze");
for(i = 0; i < level.awe_allplayers.size; i++)
{
if(isdefined(level.awe_allplayers))
{
thisPlayerNum = level.awe_allplayers getEntityNumber();
if(thisPlayerNum == freezePlayerNum) // this is the one we're looking for
{
level.awe_allplayers iprintlnbold("^1You have been freezed by the admin!!!");
level.awe_allplayers freezeControls(true);
iprintln(level.awe_allplayers.name + "^7 was freezed by the admin!");
}
}
}
setcvar("g_freeze", "");
}
wait 0.05;
}
}

edited on May. 13, 2017 01:18 pm by Rainbowsix

But wen i enter g_freeze only iprintlnbold and iprintln works. Anyone knows what i am doing wrong?

Share |
.KiLL3R.
General Member
Since: Oct 26, 2006
Posts: 1437
Last: Jul 3, 2017
[view latest posts]
Level 8
Category: CoD+UO General
Posted: Monday, May. 15, 2017 05:44 pm
IIRC freezeControls() doesn't work in multiplayer, it's a single player thing.

From what I can remember I think the best way was to spawn() a script_model and link() the player to it. Don't forget to delete() the script_model when the player is unfrozen/dies/disconnects/goes spectator or whatever.
Share |
Rainbowsix
General Member
Since: Jun 19, 2008
Posts: 56
Last: May 23, 2017
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Wednesday, May. 17, 2017 03:24 pm
Thank you so mutch for your reply. Can you give my a hand? My scriptning skills is not that good.
Share |
modsfabio
General Member
Since: Aug 10, 2014
Posts: 23
Last: May 18, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Thursday, May. 18, 2017 02:37 pm
Create a script_model at the beginning of your script.
We are going to link the players to this model, so they can't move.

level.freezeModel = spawn("script_model", (0,0,0));

Now you can easily "freeze" the player using this command:
self linkto(level.freezeModel);

To "unfreeze" the player use:
self unlink();
Share |
Rainbowsix
General Member
Since: Jun 19, 2008
Posts: 56
Last: May 23, 2017
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Thursday, May. 18, 2017 04:09 pm
Thanks for help. i tried this

givefreeze()
{
self endon("boot");

setcvar("g_freeze", "");
while(1)
{
if(getcvar("g_freeze") != "")
{
freezePlayerNum = getcvarint("g_freeze");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(isdefined(players))
{
thisPlayerNum = players getEntityNumber();
if(thisPlayerNum == freezePlayerNum)
{

level.freezeModel = spawn("script_model", (0,0,0));
self linkto(level.freezeModel);
players iprintlnbold("^1You have been freezed by the admin!!!");
iprintln(players.name + "^7 was freezed by the admin!");
}
}
}
setcvar("g_freeze", "");
}
wait 0.05;
}
}

But it dosent work only the iprint works. Any idea what is wrong?
Share |
Donefore
General Member
Since: May 1, 2009
Posts: 165
Last: Sep 20, 2018
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD+UO General
Posted: Thursday, May. 18, 2017 08:12 pm
I have seen this Before
But
It would lift the person in the Air and hold them there with No weapon till someone killed the person,and you could not switch teams or spectate.
I will look more for this mod

Share |
modsfabio
General Member
Since: Aug 10, 2014
Posts: 23
Last: May 18, 2017
[view latest posts]
Level 1
Category: CoD+UO General
Posted: Thursday, May. 18, 2017 10:32 pm
Try it like this (not tested):
Code:

givefreeze()
{
	self endon("boot");

	level.freezeModel = spawn("script_model", (0,0,0));

	setcvar("g_freeze", "");
	while(1)
	{
		if(getcvar("g_freeze") != "")
		{
			freezePlayerNum = getcvarint("g_freeze");
			players = getentarray("player", "classname");
			for(i = 0; i < players.size; i++)
			{
				thisPlayerNum = players[i] getEntityNumber();
				if(thisPlayerNum == freezePlayerNum) 
				{
					players[i] linkto(level.freezeModel);
					players[i] iprintlnbold("^1You have been freezed by the admin!!!");
					iprintln(players[i].name + "^7 was freezed by the admin!");
				}
			}
			setcvar("g_freeze", "");
		}
		wait 0.05;
	}	
}
Share |
Rainbowsix
General Member
Since: Jun 19, 2008
Posts: 56
Last: May 23, 2017
[view latest posts]
Level 3
Category: CoD+UO General
Posted: Tuesday, May. 23, 2017 03:28 pm
It worked. Thank you very much for helping out!
Share |
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty : CoD+UO General

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»