player onDeath - 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: player onDeath (
/showthread.php?tid=415717)
player onDeath -
Dotayuri - 14.02.2013
I have a register system filterscrip with onPlayerConnect i set the deaths to 0,
PHP код:
public OnPlayerConnect(playerid) {
playerinfo[MAX_PLAYERS][deaths] = 0;
}
but in my gamemode function onPlayerDeath i want to add to that value
should i save the value to a database in sqllight,
and get the deaths from db_query 'onPlayerDeath'
or
should i just set the values in the gamemode file so i dont have to use a database
Re: player onDeath -
]Rafaellos[ - 14.02.2013
Did you try to add "playerinfo[playerid][deaths]++;" on "OnPlayerDeath" and then save it with your register system?
Re: player onDeath -
MP2 - 14.02.2013
You should increment the variable under OnPlayerDeath then save it either when they disconnect (OnPlayerDisconnect) or periodically (every 5 minutes or so).
Storing it as soon as it's increased wouldn't be a massive issue though. I do that for some 'important' stats that players wouldn't want to lose. This isn't really one of those though.
Re: player onDeath -
Dotayuri - 14.02.2013
Quote:
Originally Posted by MP2
You should increment the variable under OnPlayerDeath then save it either when they disconnect (OnPlayerDisconnect) or periodically (every 5 minutes or so).
Storing it as soon as it's increased wouldn't be a massive issue though. I do that for some 'important' stats that players wouldn't want to lose. This isn't really one of those though.
|
Yea i dont think they would mine one or two missing.
I think ill up date it on player death,
but should i update it on both the register system and gamemode "onplayerDeath"
Re: player onDeath -
MP2 - 14.02.2013
Having the registration system in a filterscript isn't really the done thing. The gamemode is where it belongs. Filterscripts are for scripts running alongside the gamemode. Core stuff (such as this) should be in the gamemode.
Re: player onDeath -
Dotayuri - 14.02.2013
Quote:
Originally Posted by MP2
Having the registration system in a filterscript isn't really the done thing. The gamemode is where it belongs. Filterscripts are for scripts running alongside the gamemode. Core stuff (such as this) should be in the gamemode.
|
Yea sorry im just starting off and im going with what i learn.
its sound right and alot easyier then it is but...is this what i should do ?
i should create a register system in gamemode
use filterscrips for Missions "trucking/gargage man"
any data need for filterscrips i can get with db_query
something like a "Bank" can i place inside gamemode
or should i make a filter scrips for that ?