Spawn - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn (
/showthread.php?tid=131531)
Spawn -
ScottCFR - 03.03.2010
How would i make it a requirement to register before spawn? I have it set if you have an account in my script files you have to login. but i want them to be registered. Thanks
Re: Spawn -
aircombat - 03.03.2010
public OnPlayerRequestSpawn(playerid)
{
//urcode
return 1;
}
________
MICHIGAN MEDICAL MARIJUANA DISPENSARIES
Re: Spawn -
Ironboy500 - 03.03.2010
OnPlayerRequestSpawn check if account is registered. if not just put return 0;else if it is return 1;
Re: Spawn -
ScottCFR - 04.03.2010
So it would be...
Код:
public OnPlayerRequestSpawn(playerid)
{
[AccountInfo][playerid]IsPlayerRegestered;
}
Re: Spawn -
Miguel - 04.03.2010
No, it should be something like:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(Player_Info[playerid][Regged] == 0) change Player_Info[playerid][Regged] == 0 for you variable or function to check that
{
// code
return 0;
}
return 1;
}
Re: Spawn -
Conroy - 06.03.2010
There is actually a very simple way in doing this:
pawn Код:
new PlayerVerify;
public OnPlayerConnect(playerid)
PlayerVerify = 0;
// Rest of your OnPlayerConnect code
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(login,5,cmdtext);
// Other commands...
dcmd_login(playerid,params[]) {
PlayerVerify = 1;
// Rest of your login script
public OnPlayerRequestSpawn(playerid)
{
if(PlayerVerify == 0) {
SendClientMessage(playerid, COLOR_ERROR, "ERROR: You must login/register before playing (/login [password] or /register [password]).");
return 0;
}
return 1;
}
Basically, how it works is that in order to spawn, PlayerVerify MUST equal 1. In order to equal 1 the login command must have been entered.