SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/02/2015, 04:54 PM   #1
SpikY_
High-roller
 
SpikY_'s Avatar
 
Join Date: Jul 2014
Posts: 1,247
Reputation: 128
Default Kicking ip because they didn't logon to the game

Maybe you get to know what's actually my problem is by reading title!
When a player connect to server, The server get freezes and the player Couldn't Connect. it just say " Connected. Joining the game... " But after sometime! It says " Server Closed the Connection "
I think it is a problem of infinite loops. this problem occur with me once, i really don't know how to fix it!

is there is any code which prevent this error? if yes, then suggest me the codes so i can search it in my gamemode!
After reading This, i really didn't get the solution!
__________________
-
SpikY_ is offline   Reply With Quote
Old 20/02/2015, 06:04 PM   #2
arad55
Big Clucker
 
Join Date: Jul 2011
Posts: 135
Reputation: 0
Default Re: Kicking ip because they didn't logon to the game

Show your OnPlayerConnect public.
arad55 is offline   Reply With Quote
Old 20/02/2015, 06:25 PM   #3
Maximus0
Big Clucker
 
Maximus0's Avatar
 
Join Date: Oct 2014
Location: Canada
Posts: 82
Reputation: 10
Default Re: Kicking ip because they didn't logon to the game

Mellnik has stated a code that shows where you are getting the loop thrown.

Quote:
Originally Posted by Mellnik View Post
There is another way to combat this using crashdetect.
Put this at the very top of your GM and use CTRL+H to replace any for by for___loop.

pawn Code:
#include <crashdetect>

#define for___loop(%1;%2;%3) \
    PrintAmxBacktrace(); \
    for(%1;%2;%3)
   
#define while___loop(%1) \
    PrintAmxBacktrace(); \
    while(%1)

This prints the call stack everytime a loop gets called. So as soon as you run into this problem simply open your server log and look for the last backtrace.

Code:
[03:34:13] [debug] AMX backtrace:
[03:34:13] [debug] #0 native PrintAmxBacktrace () [6cf42e23] from crashdetect.DLL
[03:34:13] [debug] #1 00001fa8 in main () at C:\server\gamemodes\test.pwn:30
The line number now directs you to the infinite loop in your script (Don't forget to compile with -d3 parameter)
Add this code on your script.
Maximus0 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 X because they didn't logon to the game. Mellnik Server Support 83 15/06/2016 02:26 PM
Kicking X because they didn't logon to the game. jop9888 Server Support 1 12/01/2015 04:36 PM
What does this mean -->> Kicking (ip) because they didn't logon to the game. alex_sawa00 Server Support 15 16/09/2014 08:22 AM
[HELP] kicking because they didn't logon to the game Luca12 Scripting Help 1 17/03/2014 01:07 PM
Kicking (IP) because they didn't logon to the game. Riddick94 Server Support 7 21/01/2014 02:50 PM


All times are GMT. The time now is 08:34 AM.


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