Posts: 6,242
Threads: 8
Joined: Jun 2008
That's more learning how to use dialogs than changing the script.
Learn to script, and you'll find these sort of things easier.
Posts: 455
Threads: 29
Joined: Apr 2014
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
you don't have to check this in every command.
Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by CodeStyle175
you don't have to check this in every command.
|
He does if he doesn't want people who haven't logged into the authentication system he is using, using a command.
Posts: 12
Threads: 0
Joined: Apr 2018
Quote:
Originally Posted by Sew_Sumi
He does if he doesn't want people who haven't logged into the authentication system he is using, using a command.
|
Incorrect, you can easily use the OnPlayerCommandPerformed callback, and the same thing too for OnPlayerText
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
return 1;
}
Posts: 1,506
Threads: 13
Joined: Jun 2015
But that's called after your command is executed.
Posts: 12
Threads: 0
Joined: Apr 2018
Quote:
Originally Posted by Logic_
But that's called after your command is executed.
|
I'm sure it's while you're performing the command, and if you have this at the top it will only return that message instead of the other commands if you're not logged in.
If not, then there's OnPlayerCommandReceived
Posts: 6,242
Threads: 8
Joined: Jun 2008
Quote:
Originally Posted by git
Incorrect, you can easily use the OnPlayerCommandPerformed callback, and the same thing too for OnPlayerText
|
It wasn't incorrect as much as a different method.