checkPettyCash()
From Hack Wars Wiki
| Function information for checkPettyCash() | |||
| Function | checkPettyCash() | ||
| API | Banking | Attack | Watch |
| Cost | $1,500 | $750 | $250 |
| Level | 25 | 60 | 25 |
| CPU Usage | 5 | 8 | 4 |
| Description | Banking/Watch:returns a float value representing the amount currently in the petty cash of the player using the script.
Attack: Returns a float value representing the amount currently in the petty cash of the targetted player/NPC. | ||
Banking Example
string ip = getSourceIP(); float amount = getAmount(); lowerDeposit(ip,amount); float petty = checkPettyCash(); message(ip,"You have deposited $"+amount+". Your new petty cash contains $"+petty+"."); |
This example deposits money and reports the new petty cash amount to the player.
Attack Example:
if(checkPettyCash() > 900){ emptyPettyCash(); }else{ installScript(); } |
If this was in the finalize event of an attack script it would only empty their petty cash if they had more than 900. If they do not, it will install a malicious banking script instead.
