Samp Login Bug
#1

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!
Reply
#2

OnTop
pawn Код:
LoggedIn[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
LoggedIn[playerid] = 0;
And when players login
pawn Код:
LoggedIn[playerid] = 1;
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;
}
Reply
#3

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
OnTop
pawn Код:
LoggedIn[MAX_PLAYERS];
OnPlayerConnect
pawn Код:
LoggedIn[playerid] = 0;
And when players login
pawn Код:
LoggedIn[playerid] = 1;
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.
Reply
#4

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.
Reply
#5

You can return 0 on OnPlayerCommandText if LoggedIn is 0
Edit: Above poster ^^
Reply
#6

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
You can return 0 on OnPlayerCommandText if LoggedIn is 0
Edit: Above poster ^^
Even better idea
Reply
#7

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");
 }
Reply
#8

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


Forum Jump:


Users browsing this thread: 2 Guest(s)