SA-MP Forums Archive
Money to score - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Money to score (/showthread.php?tid=268336)



Money to score - SydonaiCZ - 12.07.2011

Can someone make filescript money to score and /null reset cash ? thx


Re: Money to score - Wesley221 - 12.07.2011

pawn Код:
CMD:null(playerid, cmdtext[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerScore(i, 0);
        SetPlayerMoney(i, 0);
    }
    return 1;
}

stock SetPlayerMoney(playerid, cash)
{
  ResetPlayerMoney(playerid);
  return GivePlayerMoney(playerid, cash);
}
This will reset everyone's money & score


Re: Money to score - SydonaiCZ - 12.07.2011

Thx now pls someone make money to score


Re: Money to score - RyDeR` - 12.07.2011

Take a look in LVDM. You have a nice example in there.


Re: Money to score - SydonaiCZ - 12.07.2011

what is that LVDM ?


Re: Money to score - Basicz - 12.07.2011

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.


Re: Money to score - Shadoww5 - 12.07.2011

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;