Help with 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: Help with login before spawn ? (
/showthread.php?tid=80368)
Help with login before spawn ? -
Mr_Finnigan - 04.06.2009
pawn Код:
OnPlayerRequestSpawn(...)
{
if(IsPlayerLoggedIn[playerid] == 0)
{
return 0;
}
return 1;
}
and some sort of timer @ OnPlayerConnect..
[/quote]
I put this in my game mode and i get these errors
Код:
C:\Documents and Settings\sanandreas\Desktop\samp server\gamemodes\SF5GDM.pwn(490) : error 028: invalid subscript (not an array or too many subscripts): "IsPlayerLoggedIn"
C:\Documents and Settings\sanandreas\Desktop\samp server\gamemodes\SF5GDM.pwn(490) : warning 215: expression has no effect
C:\Documents and Settings\sanandreas\Desktop\samp server\gamemodes\SF5GDM.pwn(490) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\sanandreas\Desktop\samp server\gamemodes\SF5GDM.pwn(490) : error 029: invalid expression, assumed zero
C:\Documents and Settings\sanandreas\Desktop\samp server\gamemodes\SF5GDM.pwn(490) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
if(IsPlayerLoggedIn[playerid] == 0)
This being line 490
Re: Help with login before spawn ? -
HuRRiCaNe - 04.06.2009
pawn Код:
OnPlayerRequestSpawn(...)
{
{
if(IsPlayerLoggedIn[playerid] == 0);
}
return 0;
}
return 1;
}
and some sort of timer @ OnPlayerConnect..
Re: Help with login before spawn ? -
Mr_Finnigan - 04.06.2009
i get same errors?
Код:
OnPlayerRequestSpawn(...)
also why (...) when its always (playerid)
Re: Help with login before spawn ? -
HuRRiCaNe - 04.06.2009
Quote:
Originally Posted by Mr_FinnigaN
i get same errors?
Код:
OnPlayerRequestSpawn(...)
also why (...) when its always (playerid)
|

i dunno u made it :P
Re: Help with login before spawn ? -
Mr_Finnigan - 04.06.2009
I did not make,i searched and found it and tried to put it in my gamemode.
Does anyone know how to make it so you cannot spawn unless you login?
Re: Help with login before spawn ? -
efeX - 04.06.2009
You can't make them NOT spawn, BUT you can do a check to see if they have logged in before spawning and deny them...
This code isn't tested/nor expected to work, just an example
Код:
new PlayerState[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if (PlayerState[playerid] == 0) // not logged in?
{
SendClientMessage(playerid, 0xFFFFFFFF, "You must login before spawning!");
Kick(playerid);
}
}
Re: Help with login before spawn ? -
Drift_King786 - 04.06.2009
or change the kick into setting their health to 0
Re: Help with login before spawn ? -
TheUllas - 04.06.2009
Oh, why don't you kick ban rangeban him because of not-being-logged-in-before-spawning?
Код:
new PlayerState[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
if (PlayerState[playerid] == 0) // not logged in?
{
SendClientMessage(playerid, 0xFFFFFFFF, "You must login before spawning!");
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
}
}
Re: Help with login before spawn ? -
Mr_Finnigan - 04.06.2009
Thanx for the help guys,i got it to work,i found a admin filterscript with it built in.
Check the server in my sig to see it working great.
Thanx again.