I got some trouble with clickable textdraws... -
Scrillex - 12.10.2013
Hello my samp pawn colleague.
Today I want to get help from You because I'm really stuck atm...
So here is my questions:
First of all I want to display out players name... How it's possible..
pawn Код:
GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s", pName);
  Textdraw9 = TextDrawCreate(105.599937, 196.373275, "New Textdraw");
  TextDrawLetterSize(Textdraw9, 0.449999, 1.600000);
  TextDrawAlignment(Textdraw9, 1);
  TextDrawColor(Textdraw9, -5963521);
  TextDrawSetShadow(Textdraw9, 0);
  TextDrawSetOutline(Textdraw9, 1);
  TextDrawBackgroundColor(Textdraw9, 51);
  TextDrawFont(Textdraw9, 0);
  TextDrawSetProportional(Textdraw9, 1);
Second:
How to display under registration dialog clickable textdraw..
pawn Код:
case DIALOG_REGISTER:
    {
      if (!response) return Kick(playerid);
      if(response)
      {
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Making your account ..",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
        new INI:File = INI_Open(UserPath(playerid));
        INI_SetTag(File,"PlayerData");
        new HashPass[129];
        WP_Hash(HashPass, sizeof(HashPass), inputtext);
        INI_WriteString(File, "Password", HashPass);
        INI_WriteInt(File,"Cash",0);
        INI_WriteInt(File,"Admin",-1);
        INI_WriteInt(File,"Kills",0);
        INI_WriteInt(File,"Deaths",0);
        INI_Close(File);
        SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
      }
    }
3rd:
Where do I need to put my textdraw code to display them where I want atm it is under OnGamemodeInt.
Thank you for your time.
With best regards Scrillex!
Re: I got some trouble with clickable textdraws... - Patrick - 12.10.2013
Here, whole code
pawn Код:
new PlayerNameTD[MAX_PLAYERS];
public OnGameModeInt()
{
  new playerid = 0;
  PlayerNameTD[playerid] = TextDrawCreate(105.599937, 196.373275, "New Textdraw");
  TextDrawLetterSize(PlayerNameTD[playerid], 0.449999, 1.600000);
  TextDrawAlignment(PlayerNameTD[playerid], 1);
  TextDrawColor(PlayerNameTD[playerid], -5963521);
  TextDrawSetShadow(PlayerNameTD[playerid], 0);
  TextDrawSetOutline(PlayerNameTD[playerid], 1);
  TextDrawBackgroundColor(PlayerNameTD[playerid], 51);
  TextDrawFont(PlayerNameTD[playerid], 0);
  TextDrawSetProportional(PlayerNameTD[playerid], 1);
  return 1;
}
public OnPlayerSpawn(playerid)
{
  new
    pName[ MAX_PLAYER_NAME ]
    string [ 24 ];
  ;
  GetPlayerName(playerid, pName, sizeof(pName));
 Â
  format(string, sizeof(string), "%s", pName);
  TextDrawSetString(PlayerNameTD[playerid], string); Â
  return 1;
}
case DIALOG_REGISTER:
{
  if (!response) return Kick(playerid);
  if(response)
  {
    if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Making your account ..",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"PlayerData");
    new HashPass[129];
    WP_Hash(HashPass, sizeof(HashPass), inputtext);
    INI_WriteString(File, "Password", HashPass);
    INI_WriteInt(File,"Cash",0);
    INI_WriteInt(File,"Admin",-1);
    INI_WriteInt(File,"Kills",0);
    INI_WriteInt(File,"Deaths",0);
    INI_Close(File);
   Â
    TextDrawShowForPlayer(playerid, YourTextDrawVarHere); // Clickable Textdraw Here
   Â
    SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  }
}
Re: I got some trouble with clickable textdraws... -
Scrillex - 12.10.2013
Big, big thanks for your answer and your time again. Now I got it.
So that New Textdraw is for the name as I thought it will be.
Just I need to set it in the same position as the "New textdraw".
I thought maybe I can just some how edit it without text "new textdraw" and put therea name in it.
Thank you again with best regards Scrillex.