SA-MP Forums Archive
How to Not enable spawn, without registering - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to Not enable spawn, without registering (/showthread.php?tid=513554)



How to Not enable spawn, without registering - Brandondw8 - 17.05.2014

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 );
}



Re: How to Not enable spawn, without registering - Brandondw8 - 17.05.2014

Bump.


Re: How to Not enable spawn, without registering - rockhopper - 17.05.2014

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



Re: How to Not enable spawn, without registering - rockhopper - 17.05.2014

Код:
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 );
}



Re: How to Not enable spawn, without registering - Brandondw8 - 17.05.2014

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.


Re: How to Not enable spawn, without registering - Brandondw8 - 17.05.2014

Its still automatically registering them.


Re: How to Not enable spawn, without registering - rockhopper - 17.05.2014

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


Re: How to Not enable spawn, without registering - Brandondw8 - 17.05.2014

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


Re: How to Not enable spawn, without registering - rockhopper - 17.05.2014

im in
lemme ssee


Re: How to Not enable spawn, without registering - rockhopper - 17.05.2014

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 );
}