Samp Login Bug - 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: Samp Login Bug (
/showthread.php?tid=541097)
Samp Login Bug -
DarknessKnight - 09.10.2014
Players Can do commands even if they are not logged in.
How can i block Chat and commands if they have:
Код:
logged[playerid] = 0;
+REP for anyone who will help!
Re: Samp Login Bug -
Rudy_ - 09.10.2014
OnTop
OnPlayerConnect
And when players login
And when typing cmds check
pawn Код:
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, -1, "You are not loggedin");
else if(LoggedIn[playerid] == 1)
{
//Your cmd code
return 1;
}
Re: Samp Login Bug -
DarknessKnight - 09.10.2014
Quote:
Originally Posted by Rudy_
OnTop
OnPlayerConnect
And when players login
And when typing cmds check
pawn Код:
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, -1, "You are not loggedin"); else if(LoggedIn[playerid] == 1) { //Your cmd code return 1; }
|
About the last part?
is it means ill have to rewrite all cmds to this code?
Is there a simple way to block whole chat if he is
LoggedIn[PlayerID] == 0
Cuz i dont got the last part thing.
Re: Samp Login Bug -
DowntownGangster - 09.10.2014
Assuming you're using OnPlayerCommandText,
Do the following
Quote:
public OnPlayerCommandText(params....)
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, -1, "You are not loggedin");
}
|
You won't have to change all of your commands.
Re: Samp Login Bug -
Rudy_ - 09.10.2014
You can return 0 on OnPlayerCommandText if LoggedIn is 0
Edit: Above poster ^^
Re: Samp Login Bug -
DowntownGangster - 09.10.2014
Quote:
Originally Posted by Rudy_
You can return 0 on OnPlayerCommandText if LoggedIn is 0
Edit: Above poster ^^
|
Even better idea
Re: Samp Login Bug -
DarknessKnight - 09.10.2014
Quote:
Originally Posted by DowntownGangster
Even better idea
|
Listen guys , im really bad at scripting.
Playing samp only like 2 month's.
i enterd this and players still can do commands.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(logged[playerid] == 0) return SendClientMessage(playerid, -1, "You are not logged in");
}
Re: Samp Login Bug -
DarknessKnight - 09.10.2014
Never Mind Guys.
I Just Added
pawn Код:
public OnPlayerSpawn(playerid)
{
if(logged[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You are not logged in.");
SetTimerEx("KickP", 1000, false, "d", playerid);
}