Textdraw New Prob here >.< PLEEEASE HELP!! :( [waiting already a whole day....]
#1

Hey guys
I added
an AccountInfo[playerid][Hours] to SeifAdmin Scipt
and to that it works tho....
but if i do a timer now like
pawn Code:
SetTimerEx("PlayedHours",360000,1,"d",playerid);
and
then do a public of it like this
pawn Code:
public PlayedHours(playerid)
{
SetPlayerScore(playerid,AccountInfo[playerid][Hours] +1;
}
and did forward it,
it doesnt work...
it should add 1point to the score and AccountInfo[playerid][Hours].
I tried much stuff tho already :/
nutin helped i did it like
pawn Code:
public PlayedHours(playerid)
{
new score;
AccountInfo[playerid][Hours]+1;
score = AccountInfo[playerid][Hours];
SetPlayerScore(playerid,score);
}
and other ways....
had it working already but then my hd went dang wild n ye... lost it had no backup...
n now it wont work again...
Hope u guyz can help me with that...
Reply
#2

1) You should ask in the SeifAdmin topic
2) Try this
pawn Code:
// Top of script
forward PlayingTime(playerid);
new PlayingTimer[MAX_PLAYERS];
// OnPlayerConnect
PlayingTimer[playerid] = SetTimerEx(blablabla);
// OnPlayerDisconnect
KillTimer[PlayingTimer[playerid);
// Somewhere in scipt
public PlayingTime(playerid)
{
AccountInfo[playerid][Secs]++;
if(AccountInfo[playerid][Secs] == 60)
{
AccountInfo[playerid][Mins]++;
}
if(AccountInfo[playerid][Mins] == 60)
{
AccountInfo[playerid][Hours]++;
}
return 1;
}
Also add the variables Secs and Mins to thier Account, If you want only one timer then do this
pawn Code:
// Top of script
forward PlayingTime();
// OnGameModeInit
SetTimer("PlayingTime", 1000, 1);
// Somewhere in scipt
public PlayingTime()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
AccountInfo[i][Secs]++;
if(AccountInfo[i][Secs] == 60)
{
AccountInfo[i][Mins]++;
}
if(AccountInfo[i][Mins] == 60)
{
AccountInfo[i][Hours]++;
}
}
}
return 1;
}
Reply
#3

ty very much
works now...
this really pissed me off tho all day so ty man
Reply
#4

hmm but now another problem...
ive put a timer like that again started in Onplayerconnect and in it is this textdraw
pawn Code:
public Draw()
{
new str[128];
for(new i; i<MAX_PLAYERS; i++)
{
if(draw[i] == 0)
{
format(str, sizeof str, "Hours:%d Mins:%d Secs:%d",AccountInfo[i][Hours],AccountInfo[i][Mins],AccountInfo[i][Secs]);
Textdraw0 = TextDrawCreate(303.000000,432.000000,str);
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x000000ff);
TextDrawFont(Textdraw0,3);
TextDrawLetterSize(Textdraw0,0.699999,1.200000);
TextDrawColor(Textdraw0,0xffffffff);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);
TextDrawShowForPlayer(i,Textdraw0);
}
}
return 1;
}
It should show the minutes, secs n hours on the screen n update like every second but i dont get it like that so it would change like a speedometer or sumthin.
it just overlays like that.
and when i add a destroytextdraw in anyway the whole textdraw will never show up.
even if i add it in an other timer.
so can u guys pls help me with that?
Reply
#5

noone got help?....
sry for the bump tho... but this is important to me to kno tho..
Reply
#6


for real ineed help plz
Reply
#7

another *bump*
pls i dont like to bump
Reply
#8

pwease help.....
Reply
#9

You have an edit button you know that?

The problem is that you use one text draw for all players. You need to create 200 textdraws for each player. Like

Code:
new text:Textdraw0[MAX_PLAYERS];
Code:
Textdraw0[playerid] = TextDrawCreate(303.000000,432.000000,str);
TextDrawAlignment(Textdraw0[playerid],0);
TextDrawBackgroundColor(Textdraw0[playerid],0x000000ff);
TextDrawFont(Textdraw0[playerid],3);
TextDrawLetterSize(Textdraw0[playerid],0.699999,1.200000);
TextDrawColor(Textdraw0[playerid],0xffffffff);
TextDrawSetOutline(Textdraw0[playerid],1);
TextDrawSetProportional(Textdraw0[playerid],1);
TextDrawSetShadow(Textdraw0[playerid],1);
TextDrawShowForPlayer(i,Textdraw0[playerid]);
Remember this is not code that will work for your game mode. This is just a example how to make it.
Reply
#10

like i should do for every player
new text:Textdraw0[MAX_PLAYERS];
new text:Textdraw1[MAX_PLAYERS];
new text:Textdraw2[MAX_PLAYERS];
n so on?
n sry about that but i was bumping :/

Edit:
If ye i dont think that would help cuz i did that with just one player n then it shouldnt overlay i guess
i think u didnt understand wat i mean then...
i mean like
it refreshes like 5 times n then it stops
cuz its all overlayed

Another Edit: and i just saw if i connect and then reconnect it doesnt show up anymore
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)