SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 21/01/2017, 02:31 AM   #1
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 216
Reputation: 65
Red face Elegant Login / Register TextDraws

Yo, it's me again & welcome to my second release.
Today I share my Login / Register TextDraws, which have been created & scripted by me, so they're ready to use !

Previous Release

[Include] Anti-Vehiclerepair Hack


Information

As I said, I'm releasing here my Login / Register TextDraws. There are currently 12 different Functions available. I've integrated also a Realtime - TextDraw which displays the current time of the server.
Apart from the Realtime, there are 4 clickable Buttons. If you click on them, a Dialog appear with the matching information (e.g. if you click on Credits, a Dialog with all contributors to the server will appear)

Here are a few Screenshots (different colors):



Functions

HTML Code:
CreateGlobalLoginTextDraws()             - Create all Global-TextDraws
CreatePlayerLoginTextDraws(playerid)     - Create all Player-TextDraws
ShowLoginTextDraws(playerid)             - Show all TextDraws
HideLoginTextDraws(playerid)             - Hide all TextDraws
DestroyGlobalLoginTextDraws(playerid)    - Destroys all Global-TextDraws
DestroyPlayerLoginTextDraws(playerid)    - Destroys all Player-TextDraws
PlayerIsRegistered(playerid)             - Adapt the Textdraw messages to already registered players
PlayerIsNotRegistered(playerid)          - Adapt the Textdraw messages to players who are not registered
#define LoginTextDrawColor               - Change the TextDraw Color (PAWN HEX CODE)
#define TextDrawHoverColor               - Change the TextDraw Hover Color (PAWN HEX CODE)
#define LT_ServerName                    - Adapt's the Servername (Welcome to YOUR_SERVERNAME..)
#define RandomLoginColors                - Uncommented = Random TextDraw colors for each player
Example of showing TextDraws

In my case MySQL:

HTML Code:
public OnPlayerConnect(playerid)
{
    if(mysql_num_rows() != 0)
    {
      //Player is registered
      PlayerIsRegistered(playerid);
      } 
        else 
      {
      //Player is not registered
      PlayerIsNotRegistered(playerid);
    }
    return 1;
}
Credits
  • Zamaroht - TextDraw Editor
  • n0minal - This textdraws are inspired a bit by his textdraws from the old project "Zombotec"
  • Jelly23 - Great Support

Updates

v.1.0.1:
  • TextDraws are created now as Global-TextDraws, except the TextDraws which can be different from player to player
  • Renamed UpdateRealTime to LR_UpdateRealTime
  • Added Dialogs
  • Added OnPlayerClickPlayerTextDraw into the Include (need to be moved into Gamemode if the Callback is already in use)
  • Hooked OnPlayerClickTextDraw
  • Renamed / Added new Functions (see above)

v.1.0.2:
  • Added new Function: #define RandomLoginColors
  • OnPlayerClickPlayerTextDraw is now hooked (thanks to @Lordzy)
  • General Improvements..

Download

Version 1.0.2 - CLICK ME

End

There we are again, the end.. I hope you guys like it, please leave a comment.
See ya till my next release !

Last edited by JustMe.77; 11/03/2017 at 02:35 AM.
JustMe.77 is offline   Reply With Quote
Old 21/01/2017, 02:47 AM   #2
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,367
Reputation: 652
Default Re: Elegant Login / Register TextDraws

I'm here because you used a big word in the title, elegant... Not really a big word, but much better than most other titles.

And nice job! It should be a bit more customizable though, like disabling certain buttons and adding custom buttons.
Crayder is offline   Reply With Quote
Old 21/01/2017, 02:54 AM   #3
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 216
Reputation: 65
Default Re: Elegant Login / Register TextDraws

Well, suggest me another title, @Crayder.
I don't want to use "Unique" because I think it's not but also not simple because they're not simple textdraws in my opinion :P

Thanks for your opinion/suggestion
JustMe.77 is offline   Reply With Quote
Old 21/01/2017, 06:45 AM   #4
HydraHumza
Gangsta
 
HydraHumza's Avatar
 
Join Date: Oct 2014
Posts: 627
Reputation: 130
Default Re: Elegant Login / Register TextDraws

Hello,

Isn't you using old MySQL version syntax in example? At least used new MySQL version in 2k17 Thread.

O.T: I didn't see any thing called "elegant" in this thread. But still it's not bad. Keep it up.
__________________
Quote:
Originally Posted by Kalcor View Post
The fact is, I am right. And if you think I'm wrong, you are wrong.
HydraHumza is offline   Reply With Quote
Old 21/01/2017, 06:45 AM   #5
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,367
Reputation: 652
Default Re: Elegant Login / Register TextDraws

Quote:
Originally Posted by JustMe.77 View Post
Well, suggest me another title, @Crayder.
I don't want to use "Unique" because I think it's not but also not simple because they're not simple textdraws in my opinion :P
Not sure you understood me, I was complimenting the title.
Crayder is offline   Reply With Quote
Old 21/01/2017, 07:01 AM   #6
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,707
Reputation: 1176
Default Re: Elegant Login / Register TextDraws

There's no need of MAX_PLAYERS * 33 player-textdraws. Most of them which doesn't require any change can be a single global textdraw. You might also want to rename your "UpdateRealTime" to something like "IncludePrefix_UpdateRealTime" to prevent collisions since such a name can be commonly used.

You can also make this include to be more user-friendly by adding a simple callback to handle login/register button click responses.
pawn Code:
//something like:
public OnLoginRegisterTDClick(playerid, click_id) {

    if(click_id == BUTTON_1) //or perhaps BUTTON_LOGIN or BUTTON_REGISTER?
    {
        //codes.
    }
    return 1;
}

The design looks quite good, I'd consider the one with light blue.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 21/01/2017, 08:51 PM   #7
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 216
Reputation: 65
Default Re: Elegant Login / Register TextDraws

Quote:
Originally Posted by Humza View Post
Hello,

Isn't you using old MySQL version syntax in example? At least used new MySQL version in 2k17 Thread.

O.T: I didn't see any thing called "elegant" in this thread. But still it's not bad. Keep it up.
What does it matter which version I use in an EXAMPLE ? It's a snippet from my gamemode, which is using that MySQL version. Which version you use, or if you want to even use MySQL, is not my decision, it is completely yours.

If you've any suggestions regarding the Titel, let me know

Quote:
Originally Posted by Crayder View Post
Not sure you understood me, I was complimenting the title.
Yeah, I understood you wrong. I thought you mean something like this: "Your release is good but it's not worth to be called elegant" Thanks Crayder.

Quote:
Originally Posted by Lordzy View Post
There's no need of MAX_PLAYERS * 33 player-textdraws. Most of them which doesn't require any change can be a single global textdraw. You might also want to rename your "UpdateRealTime" to something like "IncludePrefix_UpdateRealTime" to prevent collisions since such a name can be commonly used.

You can also make this include to be more user-friendly by adding a simple callback to handle login/register button click responses.
pawn Code:
//something like:
public OnLoginRegisterTDClick(playerid, click_id) {

    if(click_id == BUTTON_1) //or perhaps BUTTON_LOGIN or BUTTON_REGISTER?
    {
        //codes.
    }
    return 1;
}

The design looks quite good, I'd consider the one with light blue.
I'll maybe change the Textdraws which don't have to be PlayerTextDraws into normal Textdraws when I've time to, thanks for reminding me.

In my opinion the name "UpdateRealTime" is alright, but I'll change it in a few minutes, you might be right.

About the Callback, I've done that a while ago but I couldn't hook the Public, because the name was to long (I've received an error). I know, I could use y_hooks to fix that, but I don't want to. Are there any other ways, except y_hooks and changing something in a_samp ? Till that, I'll just add the public without the hooking.

Thanks for your comment, my favourite one is also blue
JustMe.77 is offline   Reply With Quote
Old 21/01/2017, 08:58 PM   #8
iLearner
Guest
 
Posts: n/a
Default Re: Elegant Login / Register TextDraws

Good work! Get a cookie.
  Reply With Quote
Old 22/01/2017, 12:07 AM   #9
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 216
Reputation: 65
Default Re: Elegant Login / Register TextDraws

Thank you, iLearner

I've made an update and implented most of the suggestions, check out the main post for more information.
JustMe.77 is offline   Reply With Quote
Old 22/01/2017, 02:06 AM   #10
JustMe.77
Huge Clucker
 
JustMe.77's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 216
Reputation: 65
Default Re: Elegant Login / Register TextDraws

Quote:
Originally Posted by patrickgtr View Post
This is not even an include in my opinion, its more like a filterscript. It needs more work in-order to function as an include.

I've also noticed that you created a timer that will be only used when a player connects and its killed when player disconnects, this timer should be killed as soon as this login textdraw is hidden as the timer has no use after it. nonetheless the design looks nice.
It wouldn't fit as Filterscript, why? Let's say you've your whole Login/Register System inside your gamemode.
Now, you want to load these things as Filterscript. How would you do the stuff I've made on "Example of showing TextDraws" (check mainpost) without messing around with CallRemoteFunction and similar stuff?
That's only 1 example of many.

If you feel like there are functions/features missing, feel free to mention them, I'm opened for any suggestion.
Another new small function will be available in the next few minutes / hours though.

About the timer:

The timer is killed automaticly in OnPlayerSpawn. Why not direct in the HideLoginTextDraws function?
I know, that's usually not the case, but imagine you've a charachter system with which you can switch ingame (without reconnecting) through accounts. You'd have to use HideLoginTextDraws & ShowLoginTextDraws multiple times and once you delete the timer in HideLoginTextDraw, it wouldn't update the Time anymore.

PS: Thanks for your comment.
JustMe.77 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Register/login with clickable textdraws UltraScripter Filterscripts 12 03/04/2016 12:54 PM
[FilterScript] Login - Register System - [Fully on textdraws] JonathanW Filterscripts 16 26/11/2014 11:05 AM
[FilterScript] Register/login with textdraws mirza1221 Filterscripts 16 14/09/2014 10:07 AM
help i have register and login no work pls help he login but player must make /register alking282 Scripting Help 11 16/04/2012 07:04 AM


All times are GMT. The time now is 02:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.