Raised This Month: $51 Target: $400
 12% 

SetEntityModel kill player sometimes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rsdtt
Senior Member
Join Date: Oct 2009
Old 12-22-2014 , 04:05   SetEntityModel kill player sometimes
Reply With Quote #1

I use this when player_spawned, in my linux system it never have problem, but last week I try to use windows server, sometimes, it kill player all the map untill change next map

How to use SetEntityModel in right?
__________________
I am learning sm now
rsdtt is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 12-22-2014 , 04:32   Re: SetEntityModel kill player sometimes
Reply With Quote #2

The game would crash if you would kill player SenEntitymodel(Entity, modelpath) probably
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
rsdtt
Senior Member
Join Date: Oct 2009
Old 12-22-2014 , 04:51   Re: SetEntityModel kill player sometimes
Reply With Quote #3

Quote:
Originally Posted by Michalplyoutube View Post
The game would crash if you would kill player SenEntitymodel(Entity, modelpath) probably
I mean I use SetEntityModel change player model that sometimes he would be killed
__________________
I am learning sm now
rsdtt is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-22-2014 , 07:39   Re: SetEntityModel kill player sometimes
Reply With Quote #4

some cases have to delay by 1 frame before do anything to player, try if it helps. Not guarantee
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_spawn"player_spawn);
}

public 
player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    
CreateTimer(0.0timer_delayGetEventInt(event"userid"), TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:timer_delay(Handle:timerany:userid)
{
    new 
client GetClientOfUserId(userid);

    if(
client != && IsClientInGame(client) && IsPlayerAlive(client))
    {
        
// Do something
    
}
    return 
Plugin_Continue;

__________________
Do not Private Message @me

Last edited by Bacardi; 12-22-2014 at 07:39.
Bacardi is offline
rsdtt
Senior Member
Join Date: Oct 2009
Old 12-22-2014 , 10:27   Re: SetEntityModel kill player sometimes
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
some cases have to delay by 1 frame before do anything to player, try if it helps. Not guarantee
PHP Code:
public OnPluginStart()
{
    
HookEvent("player_spawn"player_spawn);
}

public 
player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    
CreateTimer(0.0timer_delayGetEventInt(event"userid"), TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:timer_delay(Handle:timerany:userid)
{
    new 
client GetClientOfUserId(userid);

    if(
client != && IsClientInGame(client) && IsPlayerAlive(client))
    {
        
// Do something
    
}
    return 
Plugin_Continue;

Thanks, it mean it need to set model on next frame
__________________
I am learning sm now

Last edited by rsdtt; 12-22-2014 at 10:27.
rsdtt is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode