Why does it say that the symbol never is used?
#1

Hello, i made a textdraw for under the money that the player have, the
textdraw displays how much dollar the player has in the bank. I have 2
questions now.
1. Under what shall i place it? (At the moment, i have it under OnPlayerUpdate((This makes the Game slow)).)
2. Why do i get this error for that the symbol is not used? :
Quote:

public OnPlayerUpdate(playerid)
{
new string14[100];
new bank = PlayerInfo[playerid][pBank];
format(string14,sizeof(string14),"$%d", bank);


Textdraw4 = TextDrawCreate(498.000000, 97.000000, string14);
TextDrawBackgroundColor(Textdraw4, 255);
TextDrawFont(Textdraw4, 3);
TextDrawLetterSize(Textdraw4, 0.589999, 2.299999);
TextDrawColor(Textdraw4, -1);
TextDrawSetOutline(Textdraw4, 1);
TextDrawSetProportional(Textdraw4, 1);

TextDrawShowForPlayer(playerid, Textdraw4);
return 1;
}

Error :
Quote:

C:\Users\Ihsan\Desktop\eSports Gaming\gamemodes\eSportsGamingRP.pwn(1579) : warning 204: symbol is assigned a value that is never used: "bank"

...
Reply
#2

You never used the symbol bank.
Reply
#3

Quote:
Originally Posted by ||123||
You never used the symbol bank.
Stop to spam the forum with your childish post. He knows that the symbol "bank" is never used. You donґt must post it again -.-
Reply
#4

Quote:
Originally Posted by Flashy
Quote:
Originally Posted by ||123||
You never used the symbol bank.
Stop to spam the forum with your childish post. He knows that the symbol "bank" is never used. You donґt must post it again -.-
I don't need to use it, i just want to display what should i do to lose that error?
I don't want to do anything i only want to display.

Nevermind i solved it, but i need question 1, where under is the best, better then OnPlayerUpdate
Reply
#5

Not OnPlayerUpdate, it's called around 30-50 times/sec for each player, make a timer or something.
Reply
#6

You need to use TextDrawSetString.

Quote:
Originally Posted by Naxix
Not OnPlayerUpdate, it's called around 30-50 times/sec for each player, make a timer or something.
30/50? It's not that much lol. It's like 17/17 more, and yeah the times called depends.
Reply
#7

Quote:
Originally Posted by russooooo
You need to use TextDrawSetString.

Quote:
Originally Posted by Naxix
Not OnPlayerUpdate, it's called around 30-50 times/sec for each player, make a timer or something.
30/50? It's not that much lol. It's like 17/17 more, and yeah the times called depends.
Dosn't matter if it's 30 or 17.. It's per player, so it can cause lag if used too much anyway..
Reply
#8

Quote:
Originally Posted by Naxix
Quote:
Originally Posted by russooooo
You need to use TextDrawSetString.

Quote:
Originally Posted by Naxix
Not OnPlayerUpdate, it's called around 30-50 times/sec for each player, make a timer or something.
30/50? It's not that much lol. It's like 17/17 more, and yeah the times called depends.
Dosn't matter if it's 30 or 17.. It's per player, so it can cause lag if used too much anyway..
Yeah, i understand your point. I think he got the message now.
Reply
#9

Quote:
Originally Posted by Ihsan_Cingisiz
1. Under what shall i place it? (At the moment, i have it under OnPlayerUpdate((This makes the Game slow)).)
That code what you have is supposed to go under some public which gets calls at startup (yes, OnGameModeInit)

And update the textdraw each time you change the variable pBank, done (use TextDrawSetString)
Because it would be useless to update it if nothing happend
Reply
#10

Quote:
Originally Posted by ♣ Joker ♠
Quote:
Originally Posted by Ihsan_Cingisiz
1. Under what shall i place it? (At the moment, i have it under OnPlayerUpdate((This makes the Game slow)).)
That code what you have is supposed to go under some public which gets calls at startup (yes, OnGameModeInit)

And update the textdraw each time you change the variable pBank, done (use TextDrawSetString)
Because it would be useless to update it if nothing happend
So it'll work if i make a forward UpdateTextDraws(); and then in that UpdateTextDraw()
I do TextDrawHideForPlayer(playerid, Textdraw;
TextDrawShowForPlayer(playerid, Textdraw;
so it refreshes or is there other command for refreshing a textdraw?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)