How to script this type of command?
#2

I may not contribute much help to this, but bascially you can take a simple /pay command and have the other player /take loan.
I found this /pay command from another topic. Credits goes to SmiT.
pawn Код:
CMD:pay(playerid, params[])
{
    new P_NAME[ MAX_PLAYER_NAME ], T_NAME[ MAX_PLAYER_NAME ], sZ[ 128 ];
    if( sscanf ( params, "ui", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid -1, #Syntax /pay name ammount );
    if( params[ 0 ] == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, #Player offline );
    if( params[ 1 ] > GetPlayerMoney ( playerid ) ) return SendClientMessage( playerid, -1, #Invalid ammount );
    GetPlayerName( playerid, P_NAME, MAX_PLAYER_NAME ); GetPlayerName( params[ 0 ], T_NAME, MAX_PLAYER_NAME );
    format( sZ, sizeof ( sZ ), "You have received $%d from %s ", params[ 1 ], P_NAME );
    SendClientMessage( params[ 0 ], sZ );
    format( sZ, sizeof ( sZ ), "You have payed $%d to %s ", params[ 1 ], T_NAME );
    SendClientMessage( playerid, sZ );
    GivePlayerMoney ( playerid, - params[ 1 ] );
    GivePlayerMoney ( params[ 0 ], params[ 1 ] );
    return true;
}
Then use
pawn Код:
SendClientMessage (playerid, 0xFFFFFFFF, "If you do not pay back the money, you will be fined and jailed");
On the /take loan, I'm not that advanced for that. But just to get this topic started I wanted to contribute that ^^
Reply


Messages In This Thread
How to script this type of command? - by rangerxxll - 16.10.2011, 09:14
Re: How to script this type of command? - by nitrochegs - 16.10.2011, 10:18

Forum Jump:


Users browsing this thread: 1 Guest(s)