Money to score
#1

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

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
Reply
#3

Thx now pls someone make money to score
Reply
#4

Take a look in LVDM. You have a nice example in there.
Reply
#5

what is that LVDM ?
Reply
#6

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.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)