09.11.2010, 00:57
Hello, me and a friend are re-scripting our biz systems, but these 2 commands are giving us problems, they return Syntax, but it doesnt actually deposit or withdraw anything, thanks in advance for your help
Command: /bswithdraw [businessid] [price]
Command: /bsdeposit [businessid] [price]
Command: /bswithdraw [businessid] [price]
Код:
command(bswithdraw, playerid, params[]) // Hal Olpae Keep The Credits { new Amount, string[ 128 ], id; if( sscanf( params, "dd", id, Amount) ) { SendClientMessage( playerid, WHITE, "SYNTAX: /bswithdraw [id] [amount]" ); if ( !strcmp ( Businesses[ id ][ bOwner ], GetName ( playerid ) ) ) { if(Businesses[ id ][bVault] != -1) { format( string, sizeof( string ), "There is currently $%d in your business vault.", Businesses[ id ][bVault]); SendClientMessage( playerid, GREY, string); } } else { SendClientMessage(playerid, WHITE, "That Isn't Your Business!"); } } else { if( Player[playerid][InBusiness] == 0 ) { if ( !strcmp ( Businesses[ Player[playerid][InBusiness] ][ bOwner ], GetName ( playerid ) ) ) { if(Amount < 1) { SendClientMessage( playerid, WHITE, "Invalid amount." ); } else { if(Businesses[id][bVault] >= Amount) { if (Player[playerid][InBusiness] == id) { Player[playerid][Money] += Amount; Businesses[ id ][bVault] -= Amount; format( string, sizeof( string ), "You have withdrawn $%d from your business vault.", Amount); SendClientMessage( playerid, WHITE, string); } else { SendClientMessage( playerid, WHITE, "You're not at your business." ); } } else { SendClientMessage( playerid, WHITE, "You don't have enough cash to complete this transaction." ); } } } else { SendClientMessage(playerid, WHITE, "This Isn't Your Business!"); } } else { SendClientMessage(playerid, WHITE, "You Aren't In Any Business!"); } } return 1; }
Код:
command(bsdeposit, playerid, params[]) // Hal Olpae Keep The Credits { new Amount, string[ 128 ], id; if( sscanf( params, "dd", id, Amount) ) { SendClientMessage( playerid, WHITE, "SYNTAX: /bsdeposit [id] [amount]" ); if ( !strcmp ( Businesses[ id ][ bOwner ], GetName ( playerid ) ) ) { if(Businesses[ id ][bVault] != -1) { format( string, sizeof( string ), "There is currently $%d in your business vault.", Businesses[id][bVault]); SendClientMessage( playerid, GREY, string); } } else { SendClientMessage(playerid, WHITE, "That Isn't Your Business!"); } } else { if( Player[playerid][InBusiness] == 0 ) { if ( !strcmp ( Businesses[ id ][ bOwner ], GetName ( playerid ) ) ) { if(Amount < 1) { SendClientMessage( playerid, WHITE, "Invalid amount." ); } else { if( Player[playerid][Money] >= Amount) { if( Player[playerid][InBusiness] == id ) { Player[playerid][Money] -= Amount; Businesses[ id ][bVault] += Amount; format( string, sizeof( string ), "You have deposited $%d in to your business vault.", Amount); SendClientMessage( playerid, WHITE, string); } else { SendClientMessage( playerid, WHITE, "You're not at your business." ); } } else { SendClientMessage( playerid, WHITE, "You don't have enough cash to complete this transaction." ); } } } else { SendClientMessage(playerid, WHITE, "This Isn't Your Business!"); } } } return 1; }