[ASK] Query under OnPlayerDeath ?
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If you are about to update kills/deaths in OnPlayerDeath, then don't use variables just for getting the increased value. And why would you execute a query if the killer is not valid?

pawn Код:
new query[52];

if (killerid != INVALID_PLAYER_ID)
{
    mysql_format(mysql, query, sizeof(query), "UPDATE players SET Kills=Kills+1 WHERE ID=%d", pInfo[killerid][ID]);
    mysql_pquery(mysql, query, "", "");
}

mysql_format(mysql, query, sizeof(query), "UPDATE players SET Deaths=Deaths+1 WHERE ID=%d", pInfo[playerid][ID]);
mysql_pquery(mysql, query, "", "");
'And why would you execute a query if the killer is not valid?' I am not. Already used in my GM!

So this will not make server crash?
Reply


Messages In This Thread
[ASK] Query under OnPlayerDeath ? - by VenomMancer - 21.06.2015, 12:15
Re: [ASK] Query under OnPlayerDeath ? - by Dusan01 - 21.06.2015, 12:17
Re: [ASK] Query under OnPlayerDeath ? - by Konstantinos - 21.06.2015, 12:25
Re: [ASK] Query under OnPlayerDeath ? - by VenomMancer - 21.06.2015, 12:43

Forum Jump:


Users browsing this thread: 2 Guest(s)