How to Not enable spawn, without registering
#1

Right now the system is set to where people can spawn without registering there account, however if the account is taken it wont let them spawn without logging in.
I want it to where when they connect, if they dont have an account, they have to /register before spawning. Heres my onrequest spawn:
Код:
public OnPlayerRequestSpawn( playerid )
{
	if( INI_Exist ( pName( playerid ) ) )
	{
		if( GetPVarInt( playerid, "pLog" ) == 0 )
		{
			SendClientMessage( playerid, green, "This name is already registered. Please /login password to login to this account. ");
			return ( 0 );
		}
	}
	return ( 1 );
}
Heres my onplayerconnect:
Код:
public OnPlayerConnect( playerid )
{
 	if( GetPVarInt( playerid, "pLog" ) == 0 )
	{
		if( INI_Exist ( pName( playerid ) ) )
		{
			SystemMsg( playerid, "This name is already registered. Please /login [password] to login." );
		}
		else SystemMsg( playerid, "This name is not registered. /register password for free $150,000!" );
	}
	return ( 1 );
}
Reply
#2

Bump.
Reply
#3

WAit i just added that to my script yesterday your lucky here
Add in On player Connect
Код:
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/register");
Reply
#4

Код:
public OnPlayerConnect( playerid )
{
 	if( GetPVarInt( playerid, "pLog" ) == 0 )
	{
		if( INI_Exist ( pName( playerid ) ) )
		{
			
SystemMsg( playerid, "This name is already registered. Please /login [password] to login." );
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/login");
		}
		else{
 SystemMsg( playerid, "This name is not registered. /register password for free $150,000!" );
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/register");
}
	}
	return ( 1 );
}
Reply
#5

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
WAit i just added that to my script yesterday your lucky here
Add in On player Connect
Код:
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/register");
So all that did was automatically register a new user, create the account with a blank password and wouldnt let them login.


EDIT: Let me move it to the right place then test, hold on.
Reply
#6

Its still automatically registering them.
Reply
#7

What do you mean by automatic registering players can u give me ip lemme see your server ...
Reply
#8

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
What do you mean by automatic registering players can u give me ip lemme see your server ...
184.167.27.68:7777
Reply
#9

im in
lemme ssee
Reply
#10

try this
Код:
public OnPlayerRequestSpawn( playerid )
{
// DONT put anything here and try it 
	}
	return ( 1 );
}
Код:
public OnPlayerConnect( playerid )
{
 	if( GetPVarInt( playerid, "pLog" ) == 0 )
	{
		if( INI_Exist ( pName( playerid ) ) )
		{
			
SystemMsg( playerid, "This name is already registered. Please /login [password] to login." );
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/login");
		}
		else{
 SystemMsg( playerid, "This name is not registered. /register password for free $150,000!" );
CallRemoteFunction("OnPlayerCommandText", "is", playerid, "/register");
}
	}
	return ( 1 );
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)