Author Topic: God mode on certain skin ids  (Read 2272 times)

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
God mode on certain skin ids
« on: October 28, 2015, 09:47:06 pm »
I would like to create a script for my server that on certain skin ids you cannot kill. basically say skin 0 Claude if you are 0 you can not kill. as well if you are with skin = hobos, gangs, pimps, hookers, etc. i really don't know how i should start this script. i should be able to create the script and copy and paste it over and over until complete .

Any help would be nice on configuring this script.

This is a main script i need on my server.

Thanks for reading

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: God mode on certain skin ids
« Reply #1 on: October 28, 2015, 10:02:32 pm »
try something like IfPlayerSkin( == id );
player.Immune = true;
i dont know
Fear the wrath of god!


Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #2 on: October 28, 2015, 10:19:17 pm »
i feel like this would belong in the section of

 function onPlayerSkin

i will play around with this.

Thank you

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #3 on: October 28, 2015, 10:36:06 pm »
Wont work >:(. nothing but errors now i feel like your avatar, Luckily this is day one and i already have a suggestion maybe with your help and someone else i can figure this out.

Thank you.

ill Research God mode in the forums and see what i can use and modify the god mode with what you gave me.

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: God mode on certain skin ids
« Reply #4 on: October 29, 2015, 07:20:53 am »
try
function onPlayerSkin( player, skin );
{
             ifPlayerSkin == 1;
             player.Immune = true;
}
works?
Fear the wrath of god!


rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
Re: God mode on certain skin ids
« Reply #5 on: October 29, 2015, 11:09:57 am »
Code: [Select]
function onPlayerSkinChange( player, old, new )
{
     if (new == 1) player.Immune = true;
     else player.Immune = false;
     return 1;
}
« Last Edit: October 29, 2015, 11:12:08 am by rwwpl »

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #6 on: October 29, 2015, 02:32:32 pm »
This is awesome thank you. Have not tested. only issue i did not realize is this should of been created as a class script. for instance if you are tonny cipriani then you should be immune to anyone else's skin related/gang related. but if not it's fine i can literally get it working and maybe modify it. Thanks so much rwwpl. Trevor you we're very close. i really appreciate your attempts to help me.

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #7 on: October 29, 2015, 03:05:39 pm »
function onPlayerSkinChange( player, old, new )
{
     if (new == 1) player.Immune = true;
     if (new == 5) player.Immune = true;
     else player.Immune = false;
     return 1;
}

something like this may work.

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: God mode on certain skin ids
« Reply #8 on: October 29, 2015, 04:06:17 pm »
i know, im not a scripting master.
Fear the wrath of god!


Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #9 on: October 29, 2015, 06:43:52 pm »
okay the actual script works but in the spawn screen if you go to the skin that way it dosnt work, unless you type /skin even if you are that skin already... no clue to why this is like this. i will have to play with the actual script

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: God mode on certain skin ids
« Reply #10 on: October 29, 2015, 07:33:33 pm »
player.Skin = skinid; maybe
Fear the wrath of god!


Theremin

  • Full Member
  • ***
  • Posts: 154
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: God mode on certain skin ids
« Reply #11 on: October 30, 2015, 04:41:53 am »
okay the actual script works but in the spawn screen if you go to the skin that way it dosnt work, unless you type /skin even if you are that skin already... no clue to why this is like this. i will have to play with the actual script

Because that function is triggered only when the player changes its skin and thus spawning with a skin isn't considered a "change". Try:
Code: [Select]
function onPlayerSpawn( player, spawn )
{
if (player.Skin == 1) player.Immune = true;
else player Immune = false;
}

This function is triggered when you leave the spawnscreen upon join, as well as everytime you die and respawn.
« Last Edit: October 30, 2015, 04:44:23 am by Theremin »

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #12 on: November 01, 2015, 03:53:07 am »
hmm appears this creates god mode instead on that player only way to be able to kill is threw head shot i will play with it more. i appreciate everyone's help.

Code: [Select]
function onPlayerSpawn( player, spawn )
{
if (player.Skin == 1) player.Immune = true;
else player Immune = false;
}

This function is triggered when you leave the spawnscreen upon join, as well as everytime you die and respawn.

Theremin

  • Full Member
  • ***
  • Posts: 154
  • Karma: +48/-18
  • Worst Server Owner
    • View Profile
    • Visit my YouTube channel
Re: God mode on certain skin ids
« Reply #13 on: November 01, 2015, 06:44:28 am »
That's because the headshot.nut client script, overrides this server script, so you can either disable the headshot script, or making a godmode script through client, here is a topic which shows different ways of creating godmode through client, then you'd just need to add a way to check skin for it.

Motley

  • Full Member
  • ***
  • Posts: 252
  • Karma: +32/-34
    • View Profile
Re: God mode on certain skin ids
« Reply #14 on: November 01, 2015, 06:56:43 am »
I really appreciate everything.

until i fix it completely ill just set message player on spawn to type there skin /skin of there selected player after each time killed to ensure that there team don't kill them.

until i find a way to do something like findplayerskin function with a timer.. idk something

 ill figure something out the main objective is complete.

Thanks to everyone

Ps im applauding everyone
« Last Edit: November 01, 2015, 07:03:56 am by Help! »

 

© Liberty Unleashed Team.