Рекомендованные сообщения



10 posts in this topic

Спойлер

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

up

 

Share this post


Link to post
Share on other sites

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

У тебя 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

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

Edited by Rich_Hen

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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
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

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

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

    • GhostWill
      By GhostWill
      Первый способ с админ проверкой:
      public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { if(pInfo[playerid][admin] != 0) return 1; SetPlayerPos(playerid,fX,fY,fZ); return 1; } Второй способ без проверки на админку:
      public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { return SetPlayerPos(playerid,fX,fY,fZ); }