SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/09/2012, 02:21 PM   #1
CityWorld
Little Clucker
 
Join Date: Jul 2012
Posts: 15
Reputation: 0
Default Max 2 Players on a Hosted Server??

Hello i am new here, and this is my problem:

I have a hosted server with 50 slots, but when 2 player connect's is ok but when 3 connect the server shut's down, can anoyone help me please

(I haved the same problem before this, but it was if you login then the server shut's down(in a home server there is no problem) i changed the login without dialog now and it's working, but now can connect only 2 players, Why?)
CityWorld is offline   Reply With Quote
Old 17/09/2012, 03:37 PM   #2
dennissk
Little Clucker
 
dennissk's Avatar
 
Join Date: Apr 2012
Location: Berlín
Posts: 28
Reputation: 2
Default Re: Max 2 Players on a Hosted Server??

Let us have, have a limit of players, MAX_PLAYERS,

# undef MAX_PLAYERS
# define MAX_PLAYERS (50)


When connecting a 3 Player the server crashes? you? , Either update your Plugins and Pawn Includes the "CompuPhase". Greetings
__________________
R4PT0R
dennissk is offline   Reply With Quote
Old 17/09/2012, 03:50 PM   #3
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 271
Default Re: Max 2 Players on a Hosted Server??

This problem is usually caused by to much inefficient code inside the OnPlayerUpdate callback.

Check to make sure you have little or no loops inside OnPlayerUpdate.

Try to remember OnPlayerUpdate is called several times per second for each player that is connected.
iggy1 is offline   Reply With Quote
Old 17/09/2012, 04:10 PM   #4
CityWorld
Little Clucker
 
Join Date: Jul 2012
Posts: 15
Reputation: 0
Default Re: Max 2 Players on a Hosted Server??

Quote:
Originally Posted by dennissk View Post
Let us have, have a limit of players, MAX_PLAYERS,

# undef MAX_PLAYERS
# define MAX_PLAYERS (50)


When connecting a 3 Player the server crashes? you? , Either update your Plugins and Pawn Includes the "CompuPhase". Greetings
i added only this in my gamemode is this right?
#define MAX_PLAYERS 50

Quote:
When connecting a 3 Player the server crashes? you? , Either update your Plugins and Pawn Includes the "CompuPhase". Greetings
Yes the 2 players can play but when connect a player 3 to the server when she types /login [pass] it crashes and i must restart the server
"CompuPhase" what is this?
CityWorld is offline   Reply With Quote
Old 17/09/2012, 04:15 PM   #5
Roko_foko
Gangsta
 
Join Date: Jul 2009
Location: Croatia, Split
Posts: 541
Reputation: 44
Default Re: Max 2 Players on a Hosted Server??

Quote:
Originally Posted by CityWorld View Post


Yes the 2 players can play but when connect a player 3 to the server when she types /login [pass] it crashes and i must restart the server
"CompuPhase" what is this?
Are you sure there is file which you want to open? fread( EDIT: not fread but io_read in fopen) crashes the server if there is no file.
Roko_foko is offline   Reply With Quote
Old 17/09/2012, 04:58 PM   #6
CityWorld
Little Clucker
 
Join Date: Jul 2012
Posts: 15
Reputation: 0
Default Re: Max 2 Players on a Hosted Server??

Quote:
Originally Posted by Roko_foko View Post
Are you sure there is file which you want to open? fread( EDIT: not fread but io_read in fopen) crashes the server if there is no file.

Code:
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
	{
.... and at the end
                }//end while
                fclose(UserFile);//close the file after everything has been read in the while
		}
		else
		{
			////new loginstring[512];
			////new loginname[64];
			////GetPlayerName(playerid,loginname,sizeof(loginname));
			////format(loginstring,sizeof(loginstring),"GRESKA\nVnesete tocna lozinka:",loginname);
			////ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Logiranje","Izlez");
	        ////fclose(UserFile);
	        SCM(playerid, UC, "GRESKA:{FFFFFF}Vnesovte pogresna lozinka!");
	        gPlayerLogTries[playerid] += 1;
	        if(gPlayerLogTries[playerid] == 6) { Kick(playerid); }
	        return 1;
		}
		PlayerInfo[playerid][pAdjustable] = 0;
		ResetPlayerMoney(playerid);
                      ...........
CityWorld is offline   Reply With Quote
Old 17/09/2012, 05:14 PM   #7
Seven_of_Nine
Huge Clucker
 
Seven_of_Nine's Avatar
 
Join Date: Feb 2011
Location: Hungary
Posts: 372
Reputation: 12
Default Re: Max 2 Players on a Hosted Server??

use
Code:
fopen(string2,io_readwrite);
__________________
- seven
Seven_of_Nine is offline   Reply With Quote
Old 18/09/2012, 12:18 PM   #8
CityWorld
Little Clucker
 
Join Date: Jul 2012
Posts: 15
Reputation: 0
Default Re: Max 2 Players on a Hosted Server??

Quote:
Originally Posted by Seven_of_Nine View Post
use
Code:
fopen(string2,io_readwrite);
didn't worked : /



But before this I haved the same problem, but it was if you login then the server shut's down in a in home server there is no problem it's working fine but when i connected there and dyped my password in the dialog the server shutted down, i changed the login without dialog now(with command /login) and it's working now


But now when somebady connect and 2 login and 1 is only waiting and not login the server is working but when he types /login [pass] (the third player) then it shuts down please help me
CityWorld is offline   Reply With Quote
Old 20/09/2012, 10:57 AM   #9
CityWorld
Little Clucker
 
Join Date: Jul 2012
Posts: 15
Reputation: 0
Default Re: Max 2 Players on a Hosted Server??

bump(i must)
CityWorld is offline   Reply With Quote
Old 22/11/2016, 10:44 PM   #10
catal4n
Big Clucker
 
Join Date: Nov 2010
Location: Ploiesti, Romania
Posts: 57
Reputation: 0
Default Re: Max 2 Players on a Hosted Server??

Any fix for your problem? Exactly the same problem here.
catal4n 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
Hosted,5-15 Players CNR Server Needs Scripter(Good Offer) [Weponz] Help Archive 2 11/07/2010 08:33 AM
Looking For Scripter For Hosted Server 5-15 players 24/7 [Weponz] Help Archive 7 06/07/2010 10:02 PM


All times are GMT. The time now is 10:26 PM.


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