Show different textdraw if player is registered
#1

So hi!
I have one question so i made textdraws register and login and i wondering how do i need to different textdraws like example player join game textdraw will show something like "Register" he clicks he enter game and blabla so after he leaves games and try to join game again he gets different "Login" textdraw. I made only with register so now i don't know ho should i made something like that, because make more textdraw boxes is so usless so that's why i need it. I saw couple script ppl use somethin' like this

if (SetPVarInt(playerid, "RegisterTextDraws", 1))
{
RegisterTextDraw[playerid][0] = CreatePlayerTextDraw
PlayerTextDrawLetterSize(playerid,
PlayerTextDrawTextSize(playerid,

if (GetPVarInt(playerid, "RegisterTextDraws"))
{
PlayerTextDrawShow(playerid,

And same with LoginTextDraws, but i don't rly know is it correct or not.
Reply
#2

pm me your register script only the login and register lines i'll help you
Reply
#3

learn here
1. https://sampwiki.blast.hk/wiki/TextDrawCreate
2. https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw

pawn Код:
new Text:WelcomeRegisterText;
new Text:WelcomeLoginText;

public OnGameModeInit()
{
    // This line is used to create the textdraw.
    // Note: This creates a textdraw without any formatting.
    WelcomeRegisterText = TextDrawCreate(240.0,580.0,"Register");
    TextDrawSetSelectable(WelcomeRegisterText, 1);
   
   
    WelcomeLoginText = TextDrawCreate(240.0,580.0,"Login");
    TextDrawSetSelectable(WelcomeLoginText, 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    //This is used to show the player the textdraw when they connect.
    // ADD HERE if( player first time log in) then....
    TextDrawShowForPlayer(playerid,WelcomeRegisterText);
   
   
    //ADD HERE if( player registered) already
    TextDrawShowForPlayer(playerid,WelcomeLoginText);
   
   
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        TextDrawShowForPlayer(playerid, WelcomeRegisterText);
        TextDrawShowForPlayer(playerid, WelcomeLoginText);
        SelectTextDraw(playerid, 0xFF4040AA);
       
    }
    return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == WelcomeRegisterText)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on register textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    else if(clickedid == WelcomeLoginText)
    {
         SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on Login textdraw.");
         CancelSelectTextDraw(playerid);
         return 1;
    }
    return 0;
}
Reply
#4

Well i mean not show both textdraws, only one. Somethin' like this

So 1-When player is new, he need to register
2-When play is back and he only need to login and (register) textdraw is gone shows only login textdraw

Because show two textdraws register and login is pretty easy to make, but make somethin' like this is way harder so that's why i need help
Reply
#5

Quote:
Originally Posted by henkas
Посмотреть сообщение
Because show two textdraws register and login is pretty easy to make, but make somethin' like this is way harder so that's why i need help
It's actually exactly the same.
Reply
#6

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
It's actually exactly the same.
So this make no sense how server will notice when he need to hide register textdraw or not. System which he gave will show both textdraw at the same time i guess
Reply
#7

bump
Reply
#8

Quote:
Originally Posted by henkas
Посмотреть сообщение
So this make no sense how server will notice when he need to hide register textdraw or not. System which he gave will show both textdraw at the same time i guess
Hold up, so you don't understand how the process of the login/register system works?

When you connect, it checks for the userfile, and from there it shows the register or the login system based upon that.

What more do you need explained in this instance?


If you are simply trying to copy other peoples functions from their servers, maybe you need to start off with something a little more basic if you think this is completely different.


The 'system' which he gave, wasn't even a working example, and really, he shouldn't have even given it to you, as it's obviously not a good example. I really hope you didn't +rep him for that shitty example.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Hold up, so you don't understand how the process of the login/register system works?

When you connect, it checks for the userfile, and from there it shows the register or the login system based upon that.

What more do you need explained in this instance?


If you are simply trying to copy other peoples functions from their servers, maybe you need to start off with something a little more basic if you think this is completely different.


The 'system' which he gave, wasn't even a working example, and really, he shouldn't have even given it to you, as it's obviously not a good example. I really hope you didn't +rep him for that shitty example.
I know how register/login system works, lmao. There is other problem, like example i made textdraws in OnPlayerConnect callback and show it with stock
Код:
CreatePlayerLoginTextDraws(playerid);
Код:
ShowLoginTextDraws(playerid);
so as you know if player is connecting textdraws will show up, example
Код:
Register[playerid][4] = CreatePlayerTextDraw(playerid, 300.333374, 175.881469, "Register");
and i want to change this textdraw to login if he's already have account
Код:
Register[playerid][4] = CreatePlayerTextDraw(playerid, 300.333374, 175.881469, "Login");
i saw how ppl use systems like this to do that.
Example
Код:
stock PlayerIsRegistered(playerid)
{
  pRegistered[playerid] = true;
  PlayerTextDrawSetString(playerid, PlayerLoginTextDraw[playerid][0], !"      Login"); 
}

stock PlayerIsNotRegistered(playerid)
{
  pRegistered[playerid] = false;
  PlayerTextDrawSetString(playerid, PlayerLoginTextDraw[playerid][0], !"   Register");
}
But i dont rly know right way to do that. I made somethin' like this but the result was textdraw didn't change.
Reply
#10

So yea i pushed a little bit, everythin' seems to be pretty close to the end, but one thing. I added to login system
Код:
   PlayerTextDrawSetString(playerid, register[playerid][4],"login");
so when i connect to the server for couple seconds "register" textdraw text show ups and just then appear "login" textdraw text. So how should i fix this slowly showing up login textdraw because login textdraw appear only when login gui table show ups and just then register text changes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)