29.07.2011, 18:55
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
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;
}