Cara Bikin Textdraw Pas Register Login Pake TextDrawCreate TextDrawShowForPlayer SAMP Pawn GTA Scrip

 

#include <a_samp>
Text:TeksSaatLogin;
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Text:TeksSaatLogin);
}
// ini public penting sekali untuk gamemode.
// di public ini juga bisa untuk hapus tapi lebih baik saat player connect.
public OnGameModeInit(playerid)
{
// teks draw hanya untuk login.
TeksSaatLogin = TextDrawCreate(0.000000, // untuk kekiri kalau nilai negatif ke kanan kalau positif
300.000000, // untuk arah teks di dorong atas bawah. nilai negatif untuk ke atas dan positif untuk kebawah.
"DuniaPutu Corp."); // string untuk teks draw.
TextDrawLetterSize(TeksSaatLogin, 3.255285, // kotak dari samping
5.674167); // kotak dari bawah
TextDrawUseBox(TeksSaatLogin, 1);
TextDrawBoxColor(TeksSaatLogin, COLOR_WHITE);
TextDrawAlignment(TeksSaatLogin, 1);
TextDrawColor(TeksSaatLogin, COLOR_AQUAGREEN);
TextDrawSetOutline(TeksSaatLogin, 0);
TextDrawBackgroundColor(TeksSaatLogin, COLOR_BLACK);
TextDrawFont(TeksSaatLogin, 0);
TextDrawSetProportional(TeksSaatLogin, 3);
TextDrawSetShadow(TeksSaatLogin, 1);
TextDrawSetPreviewModel(Text:TeksSaatLogin, 319);
TextDrawSetPreviewRot(Text:TeksSaatLogin, -15.0, 0.0, 0.0);
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1) //Dialog logindi
{
//ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login","Nama yang tuan pakai sudah terdaftar\n{FF0000} Please enter a password between 0 and 68 characters","Login","Cancel");
if(!response) //If they click the cancel button
{
SendClientMessage(playerid, 0xFF0000, "You must login before you spawn!"); //Sends the client a error message
Kick(playerid); // and kicks him. ( you can change it to show the player the login dialog again by uncommenting the bottem line and commenting this one.
//ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", "This account is registered! Please log in:", "Login", "");
}
if(response) //If the player clicked login
{
TextDrawHideForPlayer(playerid, Text:TeksSaatLogin);
}
}
}

Comments