SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/06/2013, 10:30 PM   #1
[..MonTaNa..]
Huge Clucker
 
[..MonTaNa..]'s Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 411
Reputation: 7
Default OnPlayerUpdate

Removed.
__________________
FiRAT =)

Last edited by [..MonTaNa..]; 18/01/2014 at 09:25 PM.
[..MonTaNa..] is offline   Reply With Quote
Old 26/06/2013, 10:34 PM   #2
BigETI
Banned
 
Join Date: Mar 2010
Location: Germany
Posts: 1,046
Reputation: 359
Default AW: OnPlayerUpdate

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.
BigETI is offline   Reply With Quote
Old 26/06/2013, 10:35 PM   #3
[..MonTaNa..]
Huge Clucker
 
[..MonTaNa..]'s Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 411
Reputation: 7
Default Re: OnPlayerUpdate

Removed.
__________________
FiRAT =)

Last edited by [..MonTaNa..]; 18/01/2014 at 09:25 PM.
[..MonTaNa..] is offline   Reply With Quote
Old 26/06/2013, 10:36 PM   #4
BigETI
Banned
 
Join Date: Mar 2010
Location: Germany
Posts: 1,046
Reputation: 359
Default AW: OnPlayerUpdate

So do it inside this callback!
BigETI is offline   Reply With Quote
Old 26/06/2013, 10:39 PM   #5
Passout
Banned
 
Join Date: Jul 2010
Posts: 217
Reputation: 17
Default Re: OnPlayerUpdate

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 :/

http://wiki.sa-mp.com/wiki/TextDrawSetString

Put that ^^^ under OnPlayerUpdate
Passout is offline   Reply With Quote
Old 26/06/2013, 10:42 PM   #6
[..MonTaNa..]
Huge Clucker
 
[..MonTaNa..]'s Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 411
Reputation: 7
Default Re: OnPlayerUpdate

Removed.
__________________
FiRAT =)

Last edited by [..MonTaNa..]; 18/01/2014 at 09:25 PM.
[..MonTaNa..] is offline   Reply With Quote
Old 26/06/2013, 10:44 PM   #7
BigETI
Banned
 
Join Date: Mar 2010
Location: Germany
Posts: 1,046
Reputation: 359
Default AW: OnPlayerUpdate

Quote:
use to update, when it's needed to update
OnPlayerUpdate is the worst choise!
BigETI is offline   Reply With Quote
Old 26/06/2013, 10:49 PM   #8
[..MonTaNa..]
Huge Clucker
 
[..MonTaNa..]'s Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 411
Reputation: 7
Default Re: OnPlayerUpdate

Removed.
__________________
FiRAT =)

Last edited by [..MonTaNa..]; 18/01/2014 at 09:25 PM.
[..MonTaNa..] is offline   Reply With Quote
Old 26/06/2013, 10:55 PM   #9
SwisherSweet
Huge Clucker
 
SwisherSweet's Avatar
 
Join Date: Sep 2012
Location: Insideurmom
Posts: 492
Reputation: 68
Default Re: OnPlayerUpdate

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...
__________________
retired owner of 2 servers...
SwisherSweet is offline   Reply With Quote
Old 26/06/2013, 10:57 PM   #10
[..MonTaNa..]
Huge Clucker
 
[..MonTaNa..]'s Avatar
 
Join Date: Feb 2013
Location: Sweden
Posts: 411
Reputation: 7
Default Re: OnPlayerUpdate

Removed.
__________________
FiRAT =)

Last edited by [..MonTaNa..]; 18/01/2014 at 09:25 PM.
[..MonTaNa..] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with OnPlayerUpdate Cookie. Scripting Help 11 19/10/2012 11:09 AM
OnPlayerUpdate CoDeZ Scripting Help 2 10/07/2012 04:25 PM
OnPlayerUpdate: How much is too much? Jonny5 Scripting Help 4 25/04/2012 04:00 PM
OnPlayerUpdate ?? Gray Help Archive 7 01/05/2011 11:56 AM
OnPlayerUpdate Cypog Bug Reports 7 09/12/2010 06:37 PM


All times are GMT. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.