OnPlayerUpdate
#1

Removed.
Reply
#2

OnPlayerUpdate is literally updated each player update. Use OnPlayerDeath for the deaths and kills part, use to update, when it's needed to update, so for example score can be updated, if you call SetPlayerScore.
Reply
#3

Removed.
Reply
#4

So do it inside this callback!
Reply
#5

Quote:
Originally Posted by [..MonTaNa..]
View Post
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    pStats[killerid][Kills]++;
    pStats[playerid][Deaths]++;
    return 1;
}
I have a stats Textdraw & I want it to get updated with these things :/
https://sampwiki.blast.hk/wiki/TextDrawSetString

Put that ^^^ under OnPlayerUpdate
Reply
#6

Removed.
Reply
#7

Quote:

use to update, when it's needed to update

OnPlayerUpdate is the worst choise!
Reply
#8

Removed.
Reply
#9

A cmd would be better anyways, this is a quick thing i pulled out of a fs i made alittle while ago.

Code:
    new team, stringkills[128];
    format(stringkills, sizeof(stringkills), "European Kills: %d USA Kills: %d Russian Kills: %d China Kills: %d", TeamKills[EUROPE], TeamKills[USA], TeamKills[RUSSIA], TeamKills[CHINA]);
    TextDrawHideForAll(kills);///this is to update the textdraw
    TextDrawSetString(kills, stringkills);//this is to update the textdraw
    TextDrawShowForAll(kills);//this is two update the textdraw...
EDIT if you want it to update the kills for the player in a textdraw use this

OnPlayerDeath
[code]
// your code that make's +1 on kill
// your code that makes +1 deaths and kills^...

stringkills[128];
format(stringkills, sizeof(stringkills), "Kills %d Deaths %d,);
TextDrawHideForAll(kills);///this is to update the textdraw
TextDrawSetString(kills, stringkills);//this is to update the textdraw
TextDrawShowForAll(kills);//this is two update the textdraw...
Reply
#10

Removed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)