Question

Спойлер

stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[100];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      PlayerTextDrawSetString(playerid, MoneyA_TD[playerid], Str_Cash); //тут ошибка
      return true;
}

 

 

Ошибка:  error 035: argument type mismatch (argument 2)

Edited by Rich_Hen

Share this post


Link to post
Share on other sites

9 answers to this question

  • 0
stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[15];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      PlayerTextDrawSetString(playerid, MoneyA_TD[playerid], Str_Cash);
      return true;
}
// Ко всем переменным
new Text:Money_TD[1];
new PlayerText:MoneyA_TD[MAX_PLAYERS];

// В OnPlayerConnect
	MoneyA_TD[playerid] = CreatePlayerTextDraw(playerid, 513.3333, 82.1481, "1234567890");
	PlayerTextDrawLetterSize(playerid, MoneyA_TD[playerid], 0.4483, 1.5667);
	PlayerTextDrawTextSize(playerid, MoneyA_TD[playerid], 22.0000, 0.0000);
	PlayerTextDrawAlignment(playerid, MoneyA_TD[playerid], 1);
	PlayerTextDrawColor(playerid, MoneyA_TD[playerid], -1);
	PlayerTextDrawBackgroundColor(playerid, MoneyA_TD[playerid], 255);
	PlayerTextDrawFont(playerid, MoneyA_TD[playerid], 0);
	PlayerTextDrawSetProportional(playerid, MoneyA_TD[playerid], 1);
	PlayerTextDrawSetShadow(playerid, MoneyA_TD[playerid], 0);

// В OnGameModeInit
	Money_TD[0] = TextDrawCreate(460.0000, -54.0666, "lite:money");
	TextDrawTextSize(Money_TD[0], 186.0000, 293.0000);
	TextDrawAlignment(Money_TD[0], 1);
	TextDrawColor(Money_TD[0], -1);
	TextDrawBackgroundColor(Money_TD[0], 255);
	TextDrawFont(Money_TD[0], 4);
	TextDrawSetProportional(Money_TD[0], 0);
	TextDrawSetShadow(Money_TD[0], 0);
public OnPlayerConnect(playerid)
{
	new string[85];
	GetPlayerName(playerid, Player[playerid][pName], MAX_PLAYER_NAME);
	f("SELECT `Level` FROM `Accounts` WHERE `Name` = '%s'", GN(playerid));
	mysql_function_query(ConnectMySQL, string, true, "PlayerRegition","d", playerid);
//	Clear(playerid);

    TextDrawShowForPlayer(playerid, logotip_TD[0]);

// Вставишь сюда код TD, я написал какой код
	
	PlayerTextDrawShow(playerid, MoneyA_TD[playerid]);
    TextDrawShowForPlayer(playerid, Money_TD[0]);
	return true;
}

 

Share this post


Link to post
Share on other sites
  • 0

Уменьшил размер переменной.

У тебя MoneyA_TD как объявлена?

Если так:

new Text: MoneyA_TD[MAX_PLAYERS];

Вот код:

stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[15];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      TextDrawSetString(MoneyA_TD[playerid], Str_Cash); //тут ошибка
      return true;
}

А если так: 

new PlayerText: MoneyA_TD[MAX_PLAYERS];

Тот тот же код, но видимо - нужен первый

stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[15];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      PlayerTextDrawSetString(playerid, MoneyA_TD[playerid], Str_Cash); //тут ошибка
      return true;
}

Share this post


Link to post
Share on other sites
  • 0

@SCRIPTMAN , теперь данная ошибка при добавлении UpMoney(playerid); в паблик OnPlayerConnect (так же и с  OnPlayerSpawn) и ошибка возращает в эту же строку

Edited by Rich_Hen

Share this post


Link to post
Share on other sites
  • 0

@Rich_Hen так может код)

Share this post


Link to post
Share on other sites
  • 0

Покажи весь код, как объявлена переменная, как TD, как в пабликах, сток и т. д.

Share this post


Link to post
Share on other sites
  • 0

@SCRIPTMAN 

Спойлер

stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[15];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      TextDrawSetString(MoneyA_TD[playerid], Str_Cash);
      return true;
}

 

Спойлер

new Text:Money_TD[1];
new PlayerText:MoneyA_TD[MAX_PLAYERS][1];

	MoneyA_TD[playerid][0] = CreatePlayerTextDraw(playerid, 513.3333, 82.1481, "1234567890");
	PlayerTextDrawLetterSize(playerid, MoneyA_TD[playerid][0], 0.4483, 1.5667);
	PlayerTextDrawTextSize(playerid, MoneyA_TD[playerid][0], 22.0000, 0.0000);
	PlayerTextDrawAlignment(playerid, MoneyA_TD[playerid][0], 1);
	PlayerTextDrawColor(playerid, MoneyA_TD[playerid][0], -1);
	PlayerTextDrawBackgroundColor(playerid, MoneyA_TD[playerid][0], 255);
	PlayerTextDrawFont(playerid, MoneyA_TD[playerid][0], 0);
	PlayerTextDrawSetProportional(playerid, MoneyA_TD[playerid][0], 1);
	PlayerTextDrawSetShadow(playerid, MoneyA_TD[playerid][0], 0);

	Money_TD[0] = TextDrawCreate(460.0000, -54.0666, "lite:money");
	TextDrawTextSize(Money_TD[0], 186.0000, 293.0000);
	TextDrawAlignment(Money_TD[0], 1);
	TextDrawColor(Money_TD[0], -1);
	TextDrawBackgroundColor(Money_TD[0], 255);
	TextDrawFont(Money_TD[0], 4);
	TextDrawSetProportional(Money_TD[0], 0);
	TextDrawSetShadow(Money_TD[0], 0);
Спойлер


public OnPlayerSpawn(playerid)
{
    SetPlayerColor(playerid, 0xFFFFFFFF);
	SetPlayerSpawn(playerid);
	return true;
}

public OnPlayerConnect(playerid)
{
	new string[85];
	GetPlayerName(playerid, Player[playerid][pName], MAX_PLAYER_NAME);
	f("SELECT `Level` FROM `Accounts` WHERE `Name` = '%s'", GN(playerid));
	mysql_function_query(ConnectMySQL, string, true, "PlayerRegition","d", playerid);
//	Clear(playerid);

    TextDrawShowForPlayer(playerid, logotip_TD[0]);

	MoneyA_TD[playerid][0] = CreatePlayerTextDraw(playerid, 513.3333, 82.1481, "1234567890");
	PlayerTextDrawLetterSize(playerid, MoneyA_TD[playerid][0], 0.4483, 1.5667);
	PlayerTextDrawTextSize(playerid, MoneyA_TD[playerid][0], 22.0000, 0.0000);
	PlayerTextDrawAlignment(playerid, MoneyA_TD[playerid][0], 1);
	PlayerTextDrawColor(playerid, MoneyA_TD[playerid][0], -1);
	PlayerTextDrawBackgroundColor(playerid, MoneyA_TD[playerid][0], 255);
	PlayerTextDrawFont(playerid, MoneyA_TD[playerid][0], 0);
	PlayerTextDrawSetProportional(playerid, MoneyA_TD[playerid][0], 1);
	PlayerTextDrawSetShadow(playerid, MoneyA_TD[playerid][0], 0);
	
	PlayerTextDrawShow(playerid, MoneyA_TD[0][playerid]);
    TextDrawShowForPlayer(playerid, Money_TD[0]);
	return true;
}

 

 

Все, больше с данной сис-мой ничего не связано.

P/S: Делаю деньги на своих TextDraw.

Share this post


Link to post
Share on other sites
  • 0

Все работает, спасибо за помощь!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • DAYREK
      By DAYREK
      Приветствую, подготовили для вас игровой сайт. Все сделано с нуля.
       
      В систему входит:
      - Главная страница.
      - Магазин.
      - Новости.
      - Личный кабинет.
      Все системы работают, в личном кабинете отображаются данные о игроке, имущество, статистика и прочее, добавите туда по своему желанию еще что-нибудь.

      Основные языки системы:
      - HTML, CSS, JS, PHP
      База данных MySQL
       
      Если я увижу потенциал в данном сайте, буду выпускать обновления. Добавлю систему ЛК для администратора, с отслеживанием логов админов и игроков.
      Изменением настроек сервера и сайта, изменение темы сайта и прочее.

      Связь со мной тык

       
       
    • bogdan@gmail
      By bogdan@gmail
      Как исправить взрыв при создание тс через мод тоесть припосав его там создавая спавн авто