hooking OnPlayerClickPlayerTextDraw (not 31 character)
#1

PHP код:
//registertd.pwn
new PlayerText:VaraRegTD[MAX_PLAYERS][21];
static 
CreateRegisterTD(playerid)
{
VaraRegTD[playerid][7] = CreatePlayerTextDraw(playerid310.866607167.589218"Lozinka");
    
PlayerTextDrawLetterSize(playeridVaraRegTD[playerid][7], 0.1786650.799407);
    
PlayerTextDrawTextSize(playeridVaraRegTD[playerid][7], 588.0000000.000000);
    
PlayerTextDrawAlignment(playeridVaraRegTD[playerid][7], 1);
    
PlayerTextDrawColor(playeridVaraRegTD[playerid][7], -1442775126);
    
PlayerTextDrawSetShadow(playeridVaraRegTD[playerid][7], 0);
    
PlayerTextDrawSetOutline(playeridVaraRegTD[playerid][7], 1);
    
PlayerTextDrawBackgroundColor(playeridVaraRegTD[playerid][7], 255);
    
PlayerTextDrawFont(playeridVaraRegTD[playerid][7], 2);
    
PlayerTextDrawSetProportional(playeridVaraRegTD[playerid][7], 1);
    
PlayerTextDrawSetSelectable(playeridVaraRegTD[playerid][7], true);
return 
1;
}
hook OnPlayerConnect(playerid)
{
    
CreateRegisterTD(playerid);
    return 
1;
}
ShowRegisterTD(playerid)
{
    for(new 
i21i++)
    {
        
PlayerTextDrawShow(playeridVaraRegTD[playerid][i]);
    }
    return 
1;
}
//RegisterLogin.pwn
function Register(playerid)
{
    
/*TogglePlayerSpectating(playerid, true);
    InterpolateCameraPos(playerid, 501.1220, -2123.5720, 61.1148, 599.5076, -1907.3519, 61.1148, 25000);
    InterpolateCameraLookAt(playerid, 00.2217, -2123.1355, 60.7137, 598.5964, -1906.9376, 60.7237, 10000);
    ClearChat(playerid, 64);*/
    
ShowRegisterTD(playerid);
    
PlayerRegistering[playerid] = true;
    
SelectTextDraw(playerid, -1);
    
    return 
1;
}
hook OP_ClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
playertextid == VaraRegTD[playerid][7]) { ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORDD_NASLOV"{1100FF}>> {FFFFFF}Dobro nam dosli na server.\n{1100FF}>> {FFFFFF}Ovo je proces registracijue. Unesite zeljenu lozinku\n{1100FF}>> {FFFFFF}Bez brige, duzina lozinke moze biti do 65 karaktera"D_UNESID_ODUSTANI); }
    return 
1;

It won't show dialog (DIALOG_REGISTER) Where am I wrong?
Reply
#2

@Unkovic how's your server named, just curious (koji je to srv)
Reply
#3

You are not even using the correct type of textdraw this textdraw never changes so it shouldn't be a player textdraw to begin with.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You are not even using the correct type of textdraw this textdraw never changes so it shouldn't be a player textdraw to begin with.
I didn't showed code of OnDialogResponse. I'm stuck on this.
Reply
#5

https://github.com/Pottus/Texture-St...ui/guihook.pwn

I hooked it here but again why are you using the wrong kind of textdraws?
Reply
#6

Quote:
Originally Posted by Pottus
Посмотреть сообщение
https://github.com/Pottus/Texture-St...ui/guihook.pwn

I hooked it here but again why are you using the wrong kind of textdraws?
Why you think I'm using wrong kind? Can you tell me where is problem in this code so I can know where I made mistake?
Reply
#7

You only use player textdraws for output that is for individual players if the textdraw never changes or changes for all players use a global. You are needlessly creating them every time a player connects.
Reply
#8

Quote:
Originally Posted by Pottus
Посмотреть сообщение
never changes
It changes in OnDialogResponse, after filling it with password.
Reply
#9

Quote:
Originally Posted by Pottus
Посмотреть сообщение
You only use player textdraws for output that is for individual players if the textdraw never changes or changes for all players use a global. You are needlessly creating them every time a player connects.
And you did not tell me where I was wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)