Samp function
#1

Is there any way to make some function who detect is player died 100 times
Reply
#2

pawn Код:
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;
}
that's an example.
Reply
#3

Or you can use a MySQL database

Код:
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;

}
Reply
#4

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
pawn Код:
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;
}
that's an example.
oh i forgot for this thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)