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

up

 

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

    • Antoxa39
      By Antoxa39
      Дратути) Я хочу поделится с новичками одной штучкой,с помощью которой можно сделать спидометр.
       
      Объявляем глобальные переменные.
      new Text:speedtest; В public OnPlayerConnect добавляем следующее.
      speedtest = TextDrawCreate(506.599884, 394.742156, "500 KM/H");// создаем текстдрав при подключении игрока (он не будет отображатся) В конце мода создаем новую функцию.
      forward getsp(playerid); public getsp(playerid) {     new Float:cord[3];     GetVehicleVelocity(GetPlayerVehicleID(playerid),cord[0], cord[1], cord[2]);     new Float:veloc = floatsqroot(floatpower(floatabs(cord[0]), 2.0) + floatpower(floatabs(cord[1]), 2.0) + floatpower(floatabs(cord[2]), 2.0)) * 181.3;     new str[25];     format(str,sizeof(str),"KM/H %d",floatround(veloc));     TextDrawSetString(speedtest,str);     return 1; } Переходим в OnPlayerStateChange и добавляем следующее.
      if(newstate == PLAYER_STATE_DRIVER) {     TextDrawShowForPlayer(playerid,speedtest);     SetTimerEx("getsp", 1, true, "%f", playerid); } if(newstate == PLAYER_STATE_ONFOOT) {     TextDrawHideForPlayer(playerid,speedtest); } ВСЁ!) Мы создали спидометр. Удачи вам в скриптинге!)