Timer trouble
#1

pawn Код:
forward version(playerid);
pawn Код:
TextDrawShowForPlayer(playerid, Text:Vers);
        SetTimerEx("version",5000, 0, "i", playerid);
pawn Код:
public version(playerid)
{
    TextDrawHideForPlayer(playerid, Text:Vers);
}
Why the textdraw doesen't dissapear?
Reply
#2

Is Text:Vers global?
Reply
#3

Quote:
Originally Posted by Hiddos
Is Text:Vers global?
I don't understand..
Reply
#4

Quote:
Originally Posted by Razvann
Quote:
Originally Posted by Hiddos
Is Text:Vers global?
I don't understand..
Did you created it in a callback like:
pawn Код:
public Callback()
{
   new Text:Vers;
   return 1;
}
or global:
pawn Код:
new Text:Vers;

public OnGameModeInit()
{
    return 1;
}
Reply
#5

Yeah, it's global.
Reply
#6

pawn Код:
new Text:Vers; // Top of script

stock version(playerid)
{
    TextDrawHideForPlayer(playerid, Text:Vers);
    return 1;
}

// On Player Connect, or whatever, any function that contains 'playerid'
TextDrawShowForPlayer(playerid, Text:Vers);
SetTimerEx("version",5000, 0, "i", playerid);
Should work lol
Reply
#7

Quote:
Originally Posted by Joe_
pawn Код:
new Text:Vers; // Top of script

stock version(playerid)
{
   TextDrawHideForPlayer(playerid, Text:Vers);
   return 1;
}

// On Player Connect, or whatever, any function that contains 'playerid'
TextDrawShowForPlayer(playerid, Text:Vers);
SetTimerEx("version",5000, 0, "i", playerid);
Should work lol
Nope, it doesen't.
Reply
#8

Can you post the whole callback from where you do TextDrawShowForPlayer?
Reply
#9

Quote:
Originally Posted by Joe_
pawn Код:
new Text:Vers; // Top of script

stock version(playerid)
{
   TextDrawHideForPlayer(playerid, Text:Vers);
   return 1;
}

// On Player Connect, or whatever, any function that contains 'playerid'
TextDrawShowForPlayer(playerid, Text:Vers);
SetTimerEx("version",5000, 0, "i", playerid);
Should work lol
Timers must call public functions.

As for why it's not working, my only guess would be that the code doesn't know what playerid is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)