a question
#1

is there a way to detect how much a player gets for each stunt he makes because i want to make a command where you can see how much you have earned overall in stuntbonus. i do not think i can describe it better xD
Reply
#2

It's not possible by a specifiec function, since there isn't a callback or a function to detect it but,
If you don't spend your game money in any other way or you don't spend it for fast-food resturant/drinks mechines
you could just create another variable for oldcash and compare it to GetPlayerMony which means
the difference between the oldcash to the newcash is the stunt money.
Reply
#3

pawn Код:
new
    oldmoney[ MAX_PLAYERS ]
    ,newmoney[ MAX_PLAYERS ]
;

public OnPlayerUpdate( playerid ) {
    newmoney[ playerid ] = GetPlayerMoney( playerid );
    if( oldmoney[ playerid ] != newmoney[ playerid ] ) {
        new
            difference = newmoney[ playerid ] - oldmoney[ playerid ]
            ,pName[ 24 ]
        ;
        GetPlayerName( playerid, pName, 24 );
        printf( "Player %s has just earned/lost $%d.", pName, difference );
    }
    oldmoney[ playerid ] = GetPlayerMoney( playerid );
    return 1;
}
Untested, this should detect when a player gets/looses some money.
Reply
#4

thank you both for your answer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)