Timer problem
#5

Quote:
Originally Posted by TheLazySloth
Посмотреть сообщение
Код:
new
timer1[MAX_PLAYERS];
forward mytimer(playerid); public OnGameModeInit() {
dtxtdraw[MAX_PLAYERS] = TextDrawCreate(400.0,280.0, "~r~ -, health"); dtxtdraz[MAX_PLAYERS] = TextDrawCreate(450.0,280.0, "~b~ -, armour"); return 1;
} public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost) {
new
msg[128], msg2[128];
format(msg, sizeof(msg), "~r~ -%f, health", HealthLost); format(msg2, sizeof(msg2), "~b~ -%f, armour", ArmourLost); TextDrawSetString(dtxtdraw[playerid], msg); TextDrawSetString(dtxtdraz[playerid], msg2); TextDrawShowForPlayer(Target, dtxtdraw[playerid]); TextDrawShowForPlayer(Target, dtxtdraz[playerid]); timer1[playerid] = SetTimer("mytimer", 1000, false, "d", playerid); return 1;
} public mytimer(playerid) {
TextDrawHideForPlayer(playerid, dtxtdraw[playerid]); TextDrawHideForPlayer(playerid, dtxtdraw[playerid]); KillTimer(timer1[playerid]); return 1;
}
The above code was created by you, modified by me.
The above code was not tested!
The above code requires San Andreas Multiplayer 0.3d RC2 and up.

Do not forget to +rep me if this worked or explain further if the problem persists.
Thanks for the help but I am using .3c rc5
Quote:
Originally Posted by System64
Посмотреть сообщение
try
pawn Код:
timer1 = SetTimerEx("mytimer", 1000, false, "d", playerid /*or try Target than playerid*/);
testing this now
Reply


Messages In This Thread
Timer problem - by random123 - 06.10.2011, 08:24
Re: Timer problem - by TheLazySloth - 06.10.2011, 08:46
Re: Timer problem - by System64 - 06.10.2011, 08:47
Re: Timer problem - by TheLazySloth - 06.10.2011, 08:50
Re: Timer problem - by random123 - 06.10.2011, 08:51
Re: Timer problem - by TheLazySloth - 06.10.2011, 08:53
Re: Timer problem - by System64 - 06.10.2011, 09:41
Re: Timer problem - by TheLazySloth - 06.10.2011, 09:49
Re: Timer problem - by random123 - 07.10.2011, 00:12
Re: Timer problem - by random123 - 08.10.2011, 05:36

Forum Jump:


Users browsing this thread: 1 Guest(s)