Money to score
#7

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"1000true);
    return 
1;
}
forward Check();
public 
Check()
{
    for(new 
i0MAX_PLAYERS++) { SetPlayerScore(iGetPlayerMoney(i)); }
    return 
1;

Reply


Messages In This Thread
Money to score - by SydonaiCZ - 12.07.2011, 09:40
Re: Money to score - by Wesley221 - 12.07.2011, 09:53
Re: Money to score - by SydonaiCZ - 12.07.2011, 10:19
Re: Money to score - by RyDeR` - 12.07.2011, 10:22
Re: Money to score - by SydonaiCZ - 12.07.2011, 10:25
Re: Money to score - by Basicz - 12.07.2011, 10:30
Re: Money to score - by Shadoww5 - 12.07.2011, 13:21

Forum Jump:


Users browsing this thread: 3 Guest(s)