24.11.2014, 12:35
Is there any way to make some function who detect is player died 100 times
new Deaths[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
Deaths[playerid]+=1;
if(Deaths[playerid] == 100)
{
// action to be taken here (100 deaths)
}
return 1;
}
forward deathcoount(playerid); public deathcount(playerid){ new query[900]; new rows, fields; new deaths; format(query, sizeof(query), "SELECT * FROM `player_table` WHERE `playerid`=%d LIMIT 1;", playerid); mysql_query(connection, query); cache_get_data(rows,fields); if(rows){ deaths = cache_get_field_content_int(0, "deaths"); if(deaths == 100){ //action here } } return 1; }