SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 16/01/2019, 09:36 PM   #1
Graber
Big Clucker
 
Graber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 118
Reputation: 142
Default Server crashes when kicking a player inside OnPlayerStateChange

When using Kick(playerid) inside OnPlayerStateChange, and the newstate is PLAYER_STATE_DRIVER, the server crashes:

0.3.DL Windows:
Code:
[22:11:08] [debug] Server crashed due to an unknown error
[22:11:08] [debug] Native backtrace:
[22:11:08] [debug] #0 004874d1 in ?? () in samp-server.exe
[22:11:08] [debug] #1 004950b3 in ?? () in samp-server.exe
[22:11:08] [debug] #2 777fb8d0 in ?? () in C:\WINDOWS\SYSTEM32\ntdll.dll
After making some internal debugging, it seems this happens because the server tries to use the player's pointer after calling the callback, but the pointed memory was already freed because the player was kicked.
Graber is offline   Reply With Quote
Old 17/01/2019, 07:41 PM   #2
rorrobryan
Little Clucker
 
Join Date: Aug 2017
Posts: 13
Reputation: 0
Default Re: Server crashes when kicking a player inside OnPlayerStateChange

It may be that you save the data wrong or you need to add a folder of logs in scriptfiles
rorrobryan is offline   Reply With Quote
Old 18/01/2019, 12:59 PM   #3
Kaliber
High-roller
 
Kaliber's Avatar
 
Join Date: Jun 2012
Location: Localhost
Posts: 1,032
Reputation: 138
Default Re: Server crashes when kicking a player inside OnPlayerStateChange

You have to use a small timer, to delay the kick
__________________
Kaliber is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kicking player Crackerz Scripting Help 4 13/07/2017 03:23 PM
kicking player CH | FuDo Scripting Help 6 04/08/2013 10:41 PM
[Help] Kicking a player Maxips2 Scripting Help 3 28/10/2012 12:49 PM
kicking player during... P<3TS Scripting Help 13 03/08/2012 07:45 AM
All server player crashes. Reamis Help Archive 1 10/07/2009 04:15 PM


All times are GMT. The time now is 01:46 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.