[SOLVED]Login before 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: [SOLVED]Login before spawn (
/showthread.php?tid=106031)
[SOLVED]Login before spawn -
Jeffry - 01.11.2009
Is there any script that blocks registered people before spawn (that noone can use otherґs accounts), if they arenґt logged in?
So that comes: You arenґt logged in yet, so you canґt spawn. Type /login to login now.
Possible? Greetz,
Jeffry
Re: Login before spawn -
Nero_3D - 01.11.2009
pawn Код:
//OnPlayerRequestClass
if(Logged[playerid] == false) return false;
Re: Login before spawn -
dirkblok - 01.11.2009
Quote:
Originally Posted by Jeffry
Is there any script that blocks registered people before spawn (that noone can use otherґs accounts), if they arenґt logged in?
So that comes: You arenґt logged in yet, so you canґt spawn. Type /login to login now.
Possible? Greetz,
Jeffry
|
Depends on what script you are using?
You probably have a variable called Logged or Loggedin, then you can make below onplayerrequestspawn
pawn Код:
if (Logged[playerid] == 0)
{
SendClientMessage(playerid, 0xffffffff, "First login before you can spawn");
}
else
{
SendClientMessage(playerid, 0xffffffff, "You haven't loggedin yet, first login before you spawn")
Kick(playerid);
}
Re: Login before spawn -
Correlli - 01.11.2009
Quote:
Originally Posted by dirkblok
pawn Код:
if (Logged[playerid] == 0) { SendClientMessage(playerid, 0xffffffff, "First login before you can spawn"); } else { SendClientMessage(playerid, 0xffffffff, "You haven't loggedin yet, first login before you spawn") Kick(playerid); }
|
So, if variable
Logged isn't 0 (it's 1 probably?), you will kick the player?
And also this won't work for the first statement, you need to return 0.
Re: Login before spawn -
dice7 - 01.11.2009
Quote:
Originally Posted by ♣ ⓐⓢⓢ
pawn Код:
//OnPlayerRequestClass if(Logged[playerid] == false) return false;
|
Under OnPlayerRequestSpawn, else he won't be able to chose skins
Re: Login before spawn -
Nero_3D - 01.11.2009
Quote:
Originally Posted by dice7
Quote:
Originally Posted by ♣ ⓐⓢⓢ
pawn Код:
//OnPlayerRequestClass if(Logged[playerid] == false) return false;
|
Under OnPlayerRequestSpawn, else he won't be able to chose skins
|
Ah right, hard to remind all these old things
Re: Login before spawn -
Jeffry - 01.11.2009
Erm, im using a Filterscript which includes the register system. When i add this, some errors appear.
pawn Код:
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(665) : warning 217: loose indentation
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(676) : warning 217: loose indentation
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(677) : warning 217: loose indentation
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(773) : warning 217: loose indentation
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 017: undefined symbol "Logged"
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : warning 215: expression has no effect
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 001: expected token: ";", but found "]"
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 029: invalid expression, assumed zero
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Now?
Re: Login before spawn -
Almamu - 01.11.2009
Quote:
Originally Posted by Jeffry
Erm, im using a Filterscript which includes the register system. When i add this, some errors appear.
pawn Код:
C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(665) : warning 217: loose indentation C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(676) : warning 217: loose indentation C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(677) : warning 217: loose indentation C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(773) : warning 217: loose indentation C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 017: undefined symbol "Logged" C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : warning 215: expression has no effect C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 001: expected token: ";", but found "]" C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : error 029: invalid expression, assumed zero C:\Users\Patrick und Marco\Desktop\Pawn\filterscripts\ladmin4v2.pwn(925) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Now?
|
Be Sure That Your Register System Uses Logged variable and no another one... And there are some syntaxis errors, its simple to correct it...
Re: Login before spawn -
Jeffry - 01.11.2009
Lol, simple, can you tell me how?
Re: Login before spawn -
Nero_3D - 01.11.2009
the Logged variable was just an example
you need to use the variable you use!
open your admin script and search for a varaible which is called similar
and put the correct code in OnPlayerRequestSpawn
pawn Код:
if(YOUR_LOGGED_VARIABLE[playerid] == false) return !SendClientMessage(playerid, 0xffffffff, "First login before you can spawn");
If you use any admin fs and cant find the right variable, ask in the admin fs topic for it