SA-MP Forums Archive
ho i can change this command - 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: ho i can change this command (/showthread.php?tid=653254)



ho i can change this command - ShadowBlack - 29.04.2018

i want to do this command: https://pastebin.com/zqTCGqfD
like this: https://imgur.com/a/M4LxBQy

how i can? modify


Re: ho i can change this command - Sew_Sumi - 29.04.2018

That's more learning how to use dialogs than changing the script.

Learn to script, and you'll find these sort of things easier.


Re: ho i can change this command - CodeStyle175 - 29.04.2018

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.


Re: ho i can change this command - Sew_Sumi - 30.04.2018

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.


Re: ho i can change this command - git - 04.05.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;

}



Re: ho i can change this command - Logic_ - 04.05.2018

But that's called after your command is executed.


Re: ho i can change this command - git - 04.05.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


Re: ho i can change this command - Dayrion - 04.05.2018

Quote:
Originally Posted by git
Посмотреть сообщение
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
So you should use `OnPlayerCommandReceived` instead of `OnPlayerCommandPerformed`.


Re: ho i can change this command - Sew_Sumi - 04.05.2018

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.