Apply skin cause csgo game crash

Please post any questions about developing your plugin here. Please use the search function before posting!
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 3:22 pm

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.
Mahi
Senior Member
Posts: 212
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: Apply skin cause csgo game crash

Postby Mahi » Tue Feb 21, 2017 3:59 pm

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.
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 4:10 pm

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
User avatar
Ayuto
Project Leader
Posts: 1578
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Apply skin cause csgo game crash

Postby Ayuto » Tue Feb 21, 2017 5:36 pm

Does your server crash if you use Mahi's code?
viewtopic.php?p=9856#p9856

Also, please post the output of "sp info".
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 6:10 pm

You mean trying without Warcraft mod ?
I will put you my sp info when i m back. But i have the sp february build.
User avatar
satoon101
Project Leader
Posts: 2321
Joined: Sat Jul 07, 2012 1:59 am

Re: Apply skin cause csgo game crash

Postby satoon101 » Tue Feb 21, 2017 6:22 pm

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.
Image
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 6:27 pm

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
User avatar
Ayuto
Project Leader
Posts: 1578
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Apply skin cause csgo game crash

Postby Ayuto » Tue Feb 21, 2017 6:50 pm

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?
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 6:53 pm

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
User avatar
Ayuto
Project Leader
Posts: 1578
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Apply skin cause csgo game crash

Postby Ayuto » Tue Feb 21, 2017 7:07 pm

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.
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 7:39 pm

I will try.

Edit : Where is the debug.log file ?
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 7:47 pm

It's not console.log ?

Edit : I have found. But when my game crash nothing is generate.
User avatar
Ayuto
Project Leader
Posts: 1578
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Apply skin cause csgo game crash

Postby Ayuto » Tue Feb 21, 2017 8:26 pm

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.
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Tue Feb 21, 2017 9:00 pm

Yes it just client crash. Sorry I did not explain.
Thanks :)
User avatar
L'In20Cible
Project Leader
Posts: 914
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Apply skin cause csgo game crash

Postby L'In20Cible » Tue Feb 21, 2017 10:19 pm

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.
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Wed Feb 22, 2017 9:22 am

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.
existenz
Member
Posts: 67
Joined: Thu Feb 09, 2017 3:33 pm

Re: Apply skin cause csgo game crash

Postby existenz » Wed Mar 01, 2017 3:54 pm

Sorry to bump this subject :x, but no one have solution to avoid csgo game crashing when set a map model on player ?

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Predz and 3 guests