| Author |
Topic: Disallow Prone "Trigger" |
| DeekCiti |
 |
General Member Since: Mar 13, 2008 Posts: 1293 Last: Jul 9, 2016 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Monday, Feb. 16, 2009 01:17 am |
 |
Hey guys,
I'm trying to use a trigger_multiple to not allow players to go prone, while touching trigger. This is for a MP map.
I just can't figure out the right syntax here. Anyone have any ideas on how to make this work?
This is what I have right now that returns with an error:
unknown function
players[j] AllowProne( false );
Does this mean MP doesn't allow this function to be carried out?
Because I have tried many different instances of allowprone( false ); with the same error of unknown function. This only an SP thing?
Quote: Here is the raw script, I had to put spaces in the
for(i
and
for(j
lines because it won't post the code otherwise. Unless spaces are allowed, I don't know. I have a screenshot of the correct script above, without the spaces.
Code: main()
{
thread no_prone();
}
no_prone()
{
noprone = getentarray("prone","targetname");
for(i = 0 ; i < noprone.size; i++)
{
noprone[i] thread no_prone_player();
}
}
no_prone_player()
{
players = get_players();
for( j = 0 ; j < players.size; j++ )
{
players[j] AllowProne( false );
}
while(1)
{
self waittill("trigger");
iprintlnbold("touching triggers");
}
}
What am I missing? Anyone have any ideas? |
 |
|
|
| Sevenz |
 |
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
|
|
| DeekCiti |
 |
General Member Since: Mar 13, 2008 Posts: 1293 Last: Jul 9, 2016 [view latest posts] |
|
|
|
|
| _INSANE_ |
 |
General Member Since: Nov 7, 2008 Posts: 352 Last: Jul 10, 2011 [view latest posts] |
|
|
 |
|
Category: CoD4 Scripting Posted: Thursday, Feb. 19, 2009 09:33 pm |
 |
I don't think you could force them to stand back up... or prevent them from going prone... unless you do it a dirty way...
But you could just kill them... and in the future they would know not to go prone there..
try replacing your no_prone_player thread with this..
Code: no_prone_player()
{
players = get_players();
while(1)
{
self waittill("trigger");
for( j = 0 ; j < players.size; j++ )
{
if (players[j] GetStance() == "prone" && players[j] istouching(self))
{
players[j] suicide();
players[j] iprintlnbold("Do not go prone here");
} <br />
<br />
}<br />
<br />
}<br />
<br />
}
|
 |
|
|
| DeekCiti |
 |
General Member Since: Mar 13, 2008 Posts: 1293 Last: Jul 9, 2016 [view latest posts] |
|
|
|
Category: CoD4 Scripting Posted: Thursday, Feb. 19, 2009 09:44 pm |
 |
Well, INSANE,
I have a map that has water all over the map, the whole thing is a trigger. Using the Drown script everyone was using, players could drown in the water, but because the spawn points were in the "Above trigger" not the actual "drown trigger" the servers would crash with script errors. My whole point was to try to get players to not go underwater. So I had to get rid of that script in this map because of the spawn points.
So what I wanted to attempt to do was to make a trigger where only the water was, or the height of the water. Allow players to not be able to go prone while they were in the trigger. Otherwise players hide under the water and can pretty much sit under there and do what they please. You can't shoot out of the water, and bullets can't penetrate the water, so you can't get hit, underwater.
Was trying to deter from using this glitch.
I will keep the snippet though in case more testing is needed. A final version of the map has already been released. I might do some testing with this anyways. Thanks for your help. |
 |
|
|
| _INSANE_ |
 |
General Member Since: Nov 7, 2008 Posts: 352 Last: Jul 10, 2011 [view latest posts] |
|
|
 |
|
|
| SniperUK |
General Member Since: Apr 5, 2007 Posts: 13 Last: Jul 21, 2011 [view latest posts] |
|
|
 |
|
Category: CoD4 Scripting Posted: Friday, Feb. 20, 2009 11:23 pm |
 |
May I do the honors, and point you in the direction of the Drowning in Water tutorial. It's COD 2 but it still works for COD 4.
Drowning in Water
Download the attached zip file.
Hope this helps
Edit: oops, just saw that you've already used that tute. Shame realy, its'a a good tute. I've never had a problem or known of a problem with the code or crashing etc.
SniperUK
edited on Feb. 20, 2009 06:29 pm by SniperUK |
 |
|
|
| DeekCiti |
 |
General Member Since: Mar 13, 2008 Posts: 1293 Last: Jul 9, 2016 [view latest posts] |
|
|
|
|
| SniperUK |
General Member Since: Apr 5, 2007 Posts: 13 Last: Jul 21, 2011 [view latest posts] |
|
|
 |
|
|
| Sevenz |
 |
General Member Since: Apr 24, 2006 Posts: 2390 Last: May 10, 2013 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|