Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[CoD 4] Trying to set a player --
#1
Alright so I'm working on a CoD 4 mod for some guys and I'm about 80% done but I'm getting some issues regarding some of the AllowProne etc's. I read that they're SP only so I'm wondering if there's a way to change the players stance and disallow players from being anything but prone.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#2
(07-03-2013, 16:27)DidUknowiPwn Wrote: Alright so I'm working on a CoD 4 mod for some guys and I'm about 80% done but I'm getting some issues regarding some of the AllowProne etc's. I read that they're SP only so I'm wondering if there's a way to change the players stance and disallow players from being anything but prone.

I think you need this: http://www.itsmods.com/forum/Thread-Tuto...Title.html

For example: (Got it from there, just modified it)

PHP Code:
ForceProne()
{
self endon "disconnect" );
self endon "death" );

while(
1)
   {
        if(
self getStance() == "stand" || "crouch")
        {
            
self SetStance("prone");
        }
        if(
self getStance() == "crouch")
        {
             
self SetStance("prone");
        }
    
wait 0.1;
   }



I hope it will work for CoD4 too.
Reply

#3
Not really SetStance is for Singleplayer only. That's why I couldn't get it to work :/
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#4
Impossible. The only way is to use menu files and keep forcing the 'goprone' command. This will be really laggy though, and it will 'feel' really weird for the players.

You can try it, but it's not going to be good.

clientcmd.menu
Code:
#include "ui/menudef.h"

{
    menuDef
    {
        name "clientcmd"
        rect 0 0 1 1
        visible 0
        fullscreen 0

        onOpen
        {
            exec "vstr clientcmd";
            close clientcmd;
        }
    }
}

gsc:
Code:
game["menu_clientcmd"] = "clientcmd";
precacheMenu( game["menu_clientcmd"] );

ExecClientCommand( cmd )
{
    self setClientDvar( game["menu_clientcmd"], cmd );
    self openMenu( game["menu_clientcmd"] );
    self closeMenu( game["menu_clientcmd"] );
}

ExecClientCommand("goprone");
[Image: MaEIQ.png]
Reply

#5
Well that'll probably be laggy as shit. Hm I could do this, I can use get player stance and set their move speed to 0 and print something on their screen saying go prone to move. Good idea?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#6
(07-03-2013, 21:07)DidUknowiPwn Wrote: Well that'll probably be laggy as shit. Hm I could do this, I can use get player stance and set their move speed to 0 and print something on their screen saying go prone to move. Good idea?

That's certainly possible. But that's probably still not the best experience for your players.
[Image: MaEIQ.png]
Reply

#7
Eh whatever, it's the only way I could think of that actually would work (properly).

Blegh need some other help now... this whole function will not work.
Code:
chooseSnail()
{
    level endon("game_ended");
    
    while( !isDefined( level.prematchPeriod ) || level.prematchPeriod > 5 || level.prematchPeriod < 1 )
        wait 0.5;
    wait 1;
    players = getPlayersFrom( "axis" );
    
    snail = players[ rand( players.size ) ];
        
    snail endon( "disconnect" );
    while( !isAlive( snail ) )
        wait( 0.02 );
    snail clearperks();
    snail thread Sets();
    for(i=0;i<level.players.size;i++)
    {
        level.players[i] iprintlnbold("Snail has been selected");
    }
}

getPlayersFrom( team )
{
    players = [];
    
    for(i=0;i<level.players.size;i++)
    {
        if( level.players[i].team == team )
            players[ players.size ] = level.players[i];
    }
    
    return players;
}

rand( number )
{
    return randomint( 65535 ) % number;
}

I called
Code:
    level thread chooseSnail();
in main().
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#8
Well, first of all you should use wait .05, not .02.
Try moving the part from 'snail endon....' till the end of the function to a new function.
Also remember that if you just use iPrintLnbold("blabla"); without anything in front of it everyone on the server will see it anyway.
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Sentry Gun kill = Player kill Snake 8 5,859 11-07-2013, 13:41
Last Post: Nekochan
  Player can write Fl0w_.JACKDAN 2 3,344 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 88,445 07-01-2013, 15:12
Last Post: explosivebanana55
Video Preview AIZombies eXtreme 2.0 / Zombie Player (Music Player) DidUknowiPwn 4 5,860 06-24-2013, 16:37
Last Post: DidUknowiPwn
  "VEH_LinkCommonChecks: Player already has an owner" - After long games akillj 4 3,584 06-07-2013, 11:38
Last Post: akillj
  Question on how to "Spawn" a flying rocket as a player? akillj 8 5,529 06-04-2013, 01:54
Last Post: rotceh_dnih
  Using Cheat Engine with Zombies Single Player kikkawa 3 10,896 06-03-2013, 01:18
Last Post: kikkawa
  [Request] Random player model hillbilly 1 2,743 05-12-2013, 08:30
Last Post: archit
Brick [Release] MW3 Single Player CONSOLE v1.9.433 can1907 13 29,426 05-01-2013, 15:18
Last Post: vton
  Player models McKinleySPB 1 2,884 04-26-2013, 17:36
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.