Quote:
Originally Posted by Basicz
pawn Код:
/* A quick filterscript */
#include < a_samp >
new gTimer[ MAX_PLAYERS ] ;
public OnPlayerConnect( playerid ) { gTimer[ playerid ] = SetTimerEx( "MoneyToScore", 1000, true, "i", playerid );
return 1; }
public OnPlayerCommandText( playerid, cmdtext[ ] ) { if ( !strcmp( cmdtext, "/null", true ) ) return ResetPlayerMoney( playerid ), 1;
return 0; }
forward MoneyToScore( playerid ); public MoneyToScore( playerid ) { SetPlayerScore( playerid, GetPlayerMoney( playerid ) );
return 1; }
That script will update the player's score with the same amount of his/her money every ONE seconds.
|
You could use a global timer.
PHP код:
public OnGameModeInit()
{
SetTimer("Check", 1000, true);
return 1;
}
forward Check();
public Check()
{
for(new i= 0; i < MAX_PLAYERS; i ++) { SetPlayerScore(i, GetPlayerMoney(i)); }
return 1;
}