bank text bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: bank text bug (
/showthread.php?tid=553943)
bank text bug -
Rabea - 01.01.2015
hi i'm tring to do Bank money text same to raven's roleplay, but its kinda bugged
here some codes:
pawn Код:
new Text:Textdraw51[MAX_PLAYERS];
OnGameModeInIt
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++){
Textdraw51[i] = TextDrawCreate(608.000000, 98.000000, " "); // bank money
TextDrawAlignment(Textdraw51[i], 3);
TextDrawBackgroundColor(Textdraw51[i], 255);
TextDrawFont(Textdraw51[i], 3);
TextDrawLetterSize(Textdraw51[i], 0.650000, 2.199999);
TextDrawColor(Textdraw51[i], 43775);
TextDrawSetOutline(Textdraw51[i], 1);
TextDrawSetProportional(Textdraw51[i], 1);}
OnPlayerConnect
pawn Код:
new string[256];
for(new i=0; i<MAX_PLAYERS; i++){
format(string, sizeof(string),"$%d",PlayerInfo[i][pAccount]);
TextDrawSetString(Textdraw51[i], string);
TextDrawShowForPlayer(playerid,Textdraw51[i]);}
OnPlayerDissconnect
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++){
TextDrawHideForPlayer(playerid, Textdraw51[i]);}
its little buggy :c
can anyone help me plesae?
Re: bank text bug -
dusk - 01.01.2015
Why is there a loop both on OnPlayerConnect and OnPlayerDisconnect? It's absolutely pointless.
pawn Код:
public OnPlayerConnect(playerid)
{
new string[32];
format(string, sizeof(string),"$%d",PlayerInfo[playerid][pAccount]);
Textdraw51[playerid] = TextDrawCreate(608.000000, 98.000000, string); // bank money
TextDrawAlignment(Textdraw51[playerid], 3);
TextDrawBackgroundColor(Textdraw51[playerid], 255);
TextDrawFont(Textdraw51[playerid], 3);
TextDrawLetterSize(Textdraw51[playerid], 0.650000, 2.199999);
TextDrawColor(Textdraw51[playerid], 43775);
TextDrawSetOutline(Textdraw51[playerid], 1);
TextDrawSetProportional(Textdraw51[playerid], 1);
TextDrawShowForPlayer(playerid,Textdraw51[playerid]);
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawDestroy(Textdraw51[ playerid ]);
}
This is a general example. What do you even mean by "bugged"?
Re: bank text bug -
Ryz - 01.01.2015
DONT USE for(new i=0; i<MAX_PLAYERS; i++)
THATS ALL
EDIT:MR.LATE ;/
Re: bank text bug -
Rabea - 01.01.2015
i also can see the money bank for everyone :c
anyone can give me soluation?
Re: bank text bug -
Rabea - 01.01.2015
i shouldn't use ongamemodeinit? @dusk ?
Re: bank text bug -
Rabea - 01.01.2015
help me
Re: bank text bug -
Rabea - 02.01.2015
bump
Re: bank text bug -
ball - 02.01.2015
Give actual full code and explain what is bugged, not only write "its bugged".
Re: bank text bug -
Rabea - 03.01.2015
i see the bank money of all players
Re: bank text bug -
JuanStone - 03.01.2015
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#include <a_samp>
new Text:Textdraw51[MAX_PLAYERS];
public OnFilterScriptInit() // to OnGameModeInit
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
Textdraw51[playerid] = TextDrawCreate(608.000000, 98.000000, " "); // bank money
TextDrawAlignment(Textdraw51[playerid], 3);
TextDrawBackgroundColor(Textdraw51[playerid], 255);
TextDrawFont(Textdraw51[playerid], 3);
TextDrawLetterSize(Textdraw51[playerid], 0.650000, 2.199999);
TextDrawColor(Textdraw51[playerid], 43775);
TextDrawSetOutline(Textdraw51[playerid], 1);
TextDrawSetProportional(Textdraw51[playerid], 1);
}
return 1;
}
public OnPlayerConnect(playerid)
{
new string[40];
format(string, sizeof(string),"$%d", PlayerInfo[playerid][pAccount]);
TextDrawSetString(Textdraw51[playerid], string);
TextDrawShowForPlayer(playerid,Textdraw51[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
TextDrawHideForPlayer(playerid, Textdraw51[playerid]);
return 1;
}
#endif