Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Kewun on Aug 16, 2016, 08:15 AM

Title: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 16, 2016, 08:15 AM
function onPlayerActionChange( player, oldAction, newAction )
{
    if ( newAction == 12 ) // it will check if the player goes in new action.
    {
    if ( player.Weapon == 27 || player.Weapon == 26)
    {
    player.Skin = player.Skin;
    }
    }
}

Code tested and working.


Title: Re: Simple First Person aim disable for m4, ruger
Post by: KAKAN on Aug 16, 2016, 08:45 AM
instead of using player.Skin, simply use return 0 to provoke the action :p
:edit: Here's a minified form of your code:-
function onPlayerActionChange( player, oldAction, newAction )
{
    if ( newAction == 12 && ( player.Weapon == 27 || player.Weapon == 26 ) ) return 0;
    return 1;
}
Untested, but it should work.
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 16, 2016, 08:45 AM
return 0; didnt work in me ;c
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 16, 2016, 08:54 AM
nah, u can still aim first person mode with code

function onPlayerActionChange( player, oldAction, newAction )
{
    if ( newAction == 12 && ( player.Weapon == 27 || player.Weapon == 26 ) ) return 0;
    return 1;
}
Title: Re: Simple First Person aim disable for m4, ruger
Post by: vito on Aug 16, 2016, 12:10 PM
Serverside will always lag anyway...
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Beary on Aug 16, 2016, 11:34 PM
Maybe you can try this.
function onPlayerWeaponChange( player, oldwep, newwep )
{
if ( newwep == 26 || newwep == 27 ) player.CanAttack = false;
else player.CanAttack = true;
}
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 17, 2016, 05:58 AM
nah, this sucks, you cant even shoot with m4 or ruger. Better

function onPlayerActionChange( player, oldAction, newAction )
{
    if ( newAction == 12 ) // it will check if the player goes in new action.
    {
     if ( player.Weapon == 27 || player.Weapon == 26)
     {
      player.Skin = player.Skin;
     }
    }
}
Title: Re: Simple First Person aim disable for m4, ruger
Post by: EK.IceFlake on Aug 17, 2016, 08:41 AM
Why the actual fuck do you want to disable the FPS aim? The devs worked so hard on FPS and this is what they are getting :(
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 17, 2016, 08:44 AM
And what if someone doesnt like the FPS aim?
Title: Re: Simple First Person aim disable for m4, ruger
Post by: KAKAN on Aug 17, 2016, 08:56 AM
Quote from: Kewun on Aug 17, 2016, 08:44 AMAnd what if someone doesnt like the FPS aim?
Then he/she shouldn't play VCMP. That FPS looks funny, which is why I like it :p
Title: Re: Simple First Person aim disable for m4, ruger
Post by: MacTavish on Aug 22, 2016, 11:32 AM
Donno but i guess @KAKAN had made a mistake in code try testing this

function onPlayerActionChange( player, oldAction, newAction )
{
    if ( newAction == 12 && ( player.Weapon == 27 || player.Weapon == 26 ) ) return 0;
    else return 1;
}
Title: Re: Simple First Person aim disable for m4, ruger
Post by: Kewun on Aug 22, 2016, 01:13 PM
not works.