SA-MP Forums Archive
OnPlayerUpdate - 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: OnPlayerUpdate (/showthread.php?tid=446704)



OnPlayerUpdate - [..MonTaNa..] - 26.06.2013

Removed.


AW: OnPlayerUpdate - BigETI - 26.06.2013

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.


Re: OnPlayerUpdate - [..MonTaNa..] - 26.06.2013

Removed.


AW: OnPlayerUpdate - BigETI - 26.06.2013

So do it inside this callback!


Re: OnPlayerUpdate - Passout - 26.06.2013

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


Re: OnPlayerUpdate - [..MonTaNa..] - 26.06.2013

Removed.


AW: OnPlayerUpdate - BigETI - 26.06.2013

Quote:

use to update, when it's needed to update

OnPlayerUpdate is the worst choise!


Re: OnPlayerUpdate - [..MonTaNa..] - 26.06.2013

Removed.


Re: OnPlayerUpdate - SwisherSweet - 26.06.2013

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...


Re: OnPlayerUpdate - [..MonTaNa..] - 26.06.2013

Removed.