Page 1 of 1

Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 3:22 pm
by existenz
Hi every body !

I want to apply a toilet skin to a player, it works but when the player died csgo crash and i don't know why.

Syntax: Select all

_model = Model('models/props/cs_militia/toilet.mdl')

@Event('player_spawn')
def _on_player_spawn(self, player, **eargs):
player.model = self._model


Sincerly Existenz.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 3:59 pm
by Mahi
Is this the whole code? Since this should not work. You're mixing the events from my Wacraft mod with Source.Python's default events. You should try something like this:

Syntax: Select all

from players.entity import Player

_model = Model('models/props/cs_militia/toilet.mdl')
@Event('player_spawn')
def _on_player_spawn(event):
player = Player.from_userid(event['userid'])
player.model = _model


As for why the server crashes, I have no idea.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 4:10 pm
by existenz
Thanks for your answer :)

Yes i have mix heer but the real code isn't that.

I used the new version of warcraft csgo from Predz (https://github.com/Predz/SP-Warcraft-Mod).

Entire code :

Syntax: Select all

from engines.precache import Model
from . import Hero, Skill
from . import events


class Mister_Toilet(Hero):
name = 'Mister Toilet'


@Mister_Toilet.skill
class Toilet_Armor(Skill):
name = 'Toilet Armor'
description = 'You are a toilet !'
max_level = 0

_model = Model('models/props/cs_militia/toilet.mdl')

@events('player_spawn')
def _on_player_spawn(self, player, **eargs):
player.model = self._model

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 5:36 pm
by Ayuto
Does your server crash if you use Mahi's code?
viewtopic.php?p=9856#p9856

Also, please post the output of "sp info".

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 6:10 pm
by existenz
You mean trying without Warcraft mod ?
I will put you my sp info when i m back. But i have the sp february build.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 6:22 pm
by satoon101
Yes, to eliminate (minimize) all other possible factors, only load that code in Mahi's post and nothing else on your server to see if it still reproduces the crash.

*Edit: you will obviously also need to import Model and Event.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 6:27 pm
by existenz
Sp Info :
Date : 2017-02-21 18:25:36.446163
OS : Linux-3.16.0-4-amd64-x86_64-with-debian-8.7
Game : csgo
SP version : 552


I have try with the following code without warcraft and it crashed my game again.

Syntax: Select all

from players.entity import Player
from engines.precache import Model
from events import Event

_model = Model('models/props/cs_militia/toilet.mdl')

@Event('player_spawn')
def _on_player_spawn(event):
player = Player.from_userid(event['userid'])
player.model = _model

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 6:50 pm
by Ayuto
existenz wrote:Sp Info :
Date : 2017-02-21 18:25:36.446163
OS : Linux-3.16.0-4-amd64-x86_64-with-debian-8.7
Game : csgo
SP version : 552

What about the server plugins and SP plugins part?

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 6:53 pm
by existenz
I have disable all sp plugins.

Server plugins:
00: Source.Python, (C) 2012-2016, Source.Python Team.
01: Metamod:Source 1.10.6
SP plugins:
00: test

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 7:07 pm
by Ayuto
Could you please also disable MM, add -debug to your command line and test again? If that still crashes, please post the resulting debug.log. I will then do some tests on my own and get back to you.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 7:39 pm
by existenz
I will try.

Edit : Where is the debug.log file ?

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 7:47 pm
by existenz
It's not console.log ?

Edit : I have found. But when my game crash nothing is generate.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 8:26 pm
by Ayuto
Alright, just tested it and noticed that the client crashes. I thought you were talking about the server.
I will take a closer look at it tomorrow.

Since the server doesn't crash, it's correct that no debug.log is generated.

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 9:00 pm
by existenz
Yes it just client crash. Sorry I did not explain.
Thanks :)

Re: Apply skin cause csgo game crash

Posted: Tue Feb 21, 2017 10:19 pm
by L'In20Cible
Probably crashes cause the toilet is a dynamic model which cannot be ragdolled. You could hook player deaths and reset their model to the original or prevent the ragdoll from being created in the first place.

Re: Apply skin cause csgo game crash

Posted: Wed Feb 22, 2017 9:22 am
by existenz
Yes I thought about this and so I tried to put on a classic model before death but without any success, game crashing again.
Maybe i have used a bad way to do that.
And i don't know how prevent the ragdoll.

Re: Apply skin cause csgo game crash

Posted: Wed Mar 01, 2017 3:54 pm
by existenz
Sorry to bump this subject :x, but no one have solution to avoid csgo game crashing when set a map model on player ?