SA-MP Forums Archive
hooking OnPlayerClickPlayerTextDraw (not 31 character) - 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: hooking OnPlayerClickPlayerTextDraw (not 31 character) (/showthread.php?tid=664656)



hooking OnPlayerClickPlayerTextDraw (not 31 character) - Unkovic - 06.03.2019

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?


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - TokicMajstor - 06.03.2019

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


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Pottus - 06.03.2019

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.


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Unkovic - 06.03.2019

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.


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Pottus - 06.03.2019

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

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


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Unkovic - 06.03.2019

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?


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Pottus - 06.03.2019

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.


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Unkovic - 06.03.2019

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


Re: hooking OnPlayerClickPlayerTextDraw (not 31 character) - Unkovic - 06.03.2019

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?